@@ -69,17 +69,6 @@ private void RefreshLayout()
6969
7070 public class CommitGraph : Control
7171 {
72- public static readonly Pen [ ] Pens = [
73- new Pen ( Brushes . Orange , 2 ) ,
74- new Pen ( Brushes . ForestGreen , 2 ) ,
75- new Pen ( Brushes . Gold , 2 ) ,
76- new Pen ( Brushes . Magenta , 2 ) ,
77- new Pen ( Brushes . Red , 2 ) ,
78- new Pen ( Brushes . Gray , 2 ) ,
79- new Pen ( Brushes . Turquoise , 2 ) ,
80- new Pen ( Brushes . Olive , 2 ) ,
81- ] ;
82-
8372 public static readonly StyledProperty < Models . CommitGraph > GraphProperty =
8473 AvaloniaProperty . Register < CommitGraph , Models . CommitGraph > ( nameof ( Graph ) ) ;
8574
@@ -151,7 +140,7 @@ public override void Render(DrawingContext context)
151140 if ( dot . Center . Y > bottom )
152141 break ;
153142
154- context . DrawEllipse ( dotFill , Pens [ dot . Color ] , dot . Center , 3 , 3 ) ;
143+ context . DrawEllipse ( dotFill , Models . CommitGraph . Pens [ dot . Color ] , dot . Center , 3 , 3 ) ;
155144 }
156145 }
157146
@@ -168,7 +157,7 @@ private void DrawCurves(DrawingContext context, double top, double bottom)
168157 continue ;
169158
170159 var geo = new StreamGeometry ( ) ;
171- var pen = Pens [ line . Color ] ;
160+ var pen = Models . CommitGraph . Pens [ line . Color ] ;
172161 using ( var ctx = geo . Open ( ) )
173162 {
174163 var started = false ;
@@ -238,7 +227,7 @@ private void DrawCurves(DrawingContext context, double top, double bottom)
238227 ctx . QuadraticBezierTo ( link . Control , link . End ) ;
239228 }
240229
241- context . DrawGeometry ( null , Pens [ link . Color ] , geo ) ;
230+ context . DrawGeometry ( null , Models . CommitGraph . Pens [ link . Color ] , geo ) ;
242231 }
243232 }
244233 }
0 commit comments