@@ -78,5 +78,54 @@ public void DrawingLineAtRightShouldDisplay()
7878
7979 Assert . All ( locations , l => Assert . Equal ( this . red , image [ l . x , l . y ] ) ) ;
8080 }
81+
82+ [ Fact ]
83+ public void DrawingLineAtTopWith1point5pxStrokeShouldDisplay ( )
84+ {
85+ using var image = new Image < Rgba32 > ( Configuration . Default , 100 , 100 , Color . Black ) ;
86+ image . Mutate ( x => x
87+ . SetGraphicsOptions ( g => g . Antialias = false )
88+ . DrawLines (
89+ this . red ,
90+ 1.5f ,
91+ new PointF ( 0 , 0 ) ,
92+ new PointF ( 100 , 0 ) ) ) ;
93+
94+ IEnumerable < ( int x , int y ) > locations = Enumerable . Range ( 0 , 100 ) . Select ( i => ( x : i , y : 0 ) ) ;
95+ Assert . All ( locations , l => Assert . Equal ( this . red , image [ l . x , l . y ] ) ) ;
96+ }
97+
98+ [ Fact ]
99+ public void DrawingLineAtTopWith2pxStrokeShouldDisplay ( )
100+ {
101+ using var image = new Image < Rgba32 > ( Configuration . Default , 100 , 100 , Color . Black ) ;
102+ image . Mutate ( x => x
103+ . SetGraphicsOptions ( g => g . Antialias = false )
104+ . DrawLines (
105+ this . red ,
106+ 2f ,
107+ new PointF ( 0 , 0 ) ,
108+ new PointF ( 100 , 0 ) ) ) ;
109+
110+ IEnumerable < ( int x , int y ) > locations = Enumerable . Range ( 0 , 100 ) . Select ( i => ( x : i , y : 0 ) ) ;
111+ Assert . All ( locations , l => Assert . Equal ( this . red , image [ l . x , l . y ] ) ) ;
112+ }
113+
114+ [ Fact ]
115+ public void DrawingLineAtTopWith3pxStrokeShouldDisplay ( )
116+ {
117+ using var image = new Image < Rgba32 > ( Configuration . Default , 100 , 100 , Color . Black ) ;
118+ image . Mutate ( x => x
119+ . SetGraphicsOptions ( g => g . Antialias = false )
120+ . DrawLines (
121+ this . red ,
122+ 3f ,
123+ new PointF ( 0 , 0 ) ,
124+ new PointF ( 100 , 0 ) ) ) ;
125+
126+ IEnumerable < ( int x , int y ) > locations = Enumerable . Range ( 0 , 100 ) . Select ( i => ( x : i , y : 0 ) )
127+ . Concat ( Enumerable . Range ( 0 , 100 ) . Select ( i => ( x : i , y : 1 ) ) ) ;
128+ Assert . All ( locations , l => Assert . Equal ( this . red , image [ l . x , l . y ] ) ) ;
129+ }
81130 }
82131}
0 commit comments