We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5c8863 commit 8c76fc9Copy full SHA for 8c76fc9
vector/atlas.go
@@ -90,8 +90,13 @@ func (a *atlas) setPaths(dstBounds image.Rectangle, paths []*Path, antialias boo
90
a.pathIndexToAtlasRegionIndex[r.pathIndex] = i
91
}
92
93
+ w, h := dstBounds.Dx(), dstBounds.Dy()
94
+ // For antialiasing, doubled regions in the X direction are used.
95
+ if antialias {
96
+ w *= 2
97
+ }
98
// Use 2^n - 1, as a region in internal/atlas has 1px padding.
- maxImageSize := max(4093, dstBounds.Dx(), dstBounds.Dy())
99
+ maxImageSize := max(4093, w, h)
100
101
// Pack the regions into an atlas with a very simple algorithm:
102
// Order the regions by height and then place them in a row.
vector/util_test.go
@@ -225,3 +225,23 @@ func TestFillRects(t *testing.T) {
225
t.Errorf("got: %v, want: %v", got, want)
226
227
228
+
229
+// Issue #3377
230
+func TestFillRectOnBigImage(t *testing.T) {
231
+ dst := ebiten.NewImage(3000, 3000)
232
+ defer dst.Deallocate()
233
234
+ vector.FillRect(dst, 0, 0, 3000, 3000, color.White, true)
235
+ if got, want := dst.At(0, 0), (color.RGBA{0xff, 0xff, 0xff, 0xff}); got != want {
236
+ t.Errorf("got: %v, want: %v", got, want)
237
238
+ if got, want := dst.At(2980, 0), (color.RGBA{0xff, 0xff, 0xff, 0xff}); got != want {
239
240
241
+ if got, want := dst.At(0, 2980), (color.RGBA{0xff, 0xff, 0xff, 0xff}); got != want {
242
243
244
+ if got, want := dst.At(2980, 2980), (color.RGBA{0xff, 0xff, 0xff, 0xff}); got != want {
245
246
247
+}
0 commit comments