From d25d184ed70972b6f1af4c40a8701dd584b933a7 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 30 Jul 2019 19:19:30 +0900 Subject: [PATCH] graphics: Bug fix: wrong for loops in TestImageMipmap* --- examples/rotate/main.go | 1 + image_test.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/rotate/main.go b/examples/rotate/main.go index d87447e9a..d559740ed 100644 --- a/examples/rotate/main.go +++ b/examples/rotate/main.go @@ -56,6 +56,7 @@ func update(screen *ebiten.Image) error { // Move the image to the screen's center. op.GeoM.Translate(screenWidth/2, screenHeight/2) + screen.DrawImage(gophersImage, op) return nil } diff --git a/image_test.go b/image_test.go index 9aa3ca2bc..0dadcc74a 100644 --- a/image_test.go +++ b/image_test.go @@ -1037,7 +1037,7 @@ func TestImageMipmap(t *testing.T) { wantDst.DrawImage(l2, op) 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) want := wantDst.At(i, j).(color.RGBA) if !sameColors(got, want, 1) { @@ -1084,7 +1084,7 @@ func TestImageMipmapNegativeDet(t *testing.T) { allZero := true 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) want := wantDst.At(i, j).(color.RGBA) if !sameColors(got, want, 1) {