graphics: Bug fix: wrong for loops in TestImageMipmap*

This commit is contained in:
Hajime Hoshi 2019-07-30 19:19:30 +09:00
parent db1030a6d4
commit d25d184ed7
2 changed files with 3 additions and 2 deletions

View File

@ -56,6 +56,7 @@ func update(screen *ebiten.Image) error {
// Move the image to the screen's center. // Move the image to the screen's center.
op.GeoM.Translate(screenWidth/2, screenHeight/2) op.GeoM.Translate(screenWidth/2, screenHeight/2)
screen.DrawImage(gophersImage, op) screen.DrawImage(gophersImage, op)
return nil return nil
} }

View File

@ -1037,7 +1037,7 @@ func TestImageMipmap(t *testing.T) {
wantDst.DrawImage(l2, op) wantDst.DrawImage(l2, op)
for j := 0; j < h; j++ { for j := 0; j < h; j++ {
for i := 0; i < h; i++ { for i := 0; i < w; i++ {
got := gotDst.At(i, j).(color.RGBA) got := gotDst.At(i, j).(color.RGBA)
want := wantDst.At(i, j).(color.RGBA) want := wantDst.At(i, j).(color.RGBA)
if !sameColors(got, want, 1) { if !sameColors(got, want, 1) {
@ -1084,7 +1084,7 @@ func TestImageMipmapNegativeDet(t *testing.T) {
allZero := true allZero := true
for j := 0; j < h; j++ { for j := 0; j < h; j++ {
for i := 0; i < h; i++ { for i := 0; i < w; i++ {
got := gotDst.At(i, j).(color.RGBA) got := gotDst.At(i, j).(color.RGBA)
want := wantDst.At(i, j).(color.RGBA) want := wantDst.At(i, j).(color.RGBA)
if !sameColors(got, want, 1) { if !sameColors(got, want, 1) {