@@ -196,3 +196,32 @@ func TestFillPathSubImageAndImage(t *testing.T) {
196196 }
197197 }
198198}
199+
200+ // Issue #3357
201+ func TestFillRects (t * testing.T ) {
202+ dsts := []* ebiten.Image {
203+ ebiten .NewImage (1920 , 1080 ),
204+ ebiten .NewImage (1920 , 1080 ),
205+ }
206+ for _ , dst := range dsts {
207+ defer dst .Deallocate ()
208+ }
209+
210+ for i , antialias := range []bool {true , false } {
211+ dst := dsts [i ]
212+ vector .FillRect (dst , 593 , - 609 , 1144 , 1969 , color.RGBA {0x10 , 0x00 , 0x00 , 0x10 }, antialias )
213+ vector .FillRect (dst , 613 , - 146 , 1124 , 446 , color.RGBA {0x10 , 0x00 , 0x00 , 0x10 }, antialias )
214+ vector .FillRect (dst , 634 , - 80 , 1103 , 190 , color.RGBA {0x10 , 0x00 , 0x00 , 0x10 }, antialias )
215+ vector .FillRect (dst , 634 , 110 , 1103 , 190 , color.RGBA {0x10 , 0x00 , 0x00 , 0x10 }, antialias )
216+ vector .FillRect (dst , 613 , 300 , 1124 , 998 , color.RGBA {0x10 , 0x00 , 0x00 , 0x10 }, antialias )
217+ vector .FillRect (dst , 634 , 433 , 1104 , 865 , color.RGBA {0x10 , 0x00 , 0x00 , 0x10 }, antialias )
218+ vector .FillRect (dst , 654 , 495 , 1084 , 741 , color.RGBA {0x10 , 0x00 , 0x00 , 0x10 }, antialias )
219+ vector .FillRect (dst , 674 , 592 , 1063 , 644 , color.RGBA {0x10 , 0x00 , 0x00 , 0x10 }, antialias )
220+ }
221+
222+ got := dsts [0 ].At (800 , 0 )
223+ want := dsts [1 ].At (800 , 0 )
224+ if got != want {
225+ t .Errorf ("got: %v, want: %v" , got , want )
226+ }
227+ }
0 commit comments