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 f66fd7e commit f650b2aCopy full SHA for f650b2a
vector/atlas.go
@@ -90,8 +90,13 @@ func (a *atlas) setPaths(dstBounds image.Rectangle, paths []*Path, bounds []imag
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
@@ -126,3 +126,23 @@ func TestFillRects(t *testing.T) {
126
t.Errorf("got: %v, want: %v", got, want)
127
128
129
+
130
+// Issue #3377
131
+func TestFillRectOnBigImage(t *testing.T) {
132
+ dst := ebiten.NewImage(3000, 3000)
133
+ defer dst.Deallocate()
134
135
+ vector.FillRect(dst, 0, 0, 3000, 3000, color.White, true)
136
+ if got, want := dst.At(0, 0), (color.RGBA{0xff, 0xff, 0xff, 0xff}); got != want {
137
+ t.Errorf("got: %v, want: %v", got, want)
138
139
+ if got, want := dst.At(2980, 0), (color.RGBA{0xff, 0xff, 0xff, 0xff}); got != want {
140
141
142
+ if got, want := dst.At(0, 2980), (color.RGBA{0xff, 0xff, 0xff, 0xff}); got != want {
143
144
145
+ if got, want := dst.At(2980, 2980), (color.RGBA{0xff, 0xff, 0xff, 0xff}); got != want {
146
147
148
+}
0 commit comments