ebiten: bug fix: canSkipMipmap didn't work with negative scaling

This just means that an optimization didn't work, so this issue
should not be so serious.
This commit is contained in:
Hajime Hoshi 2024-10-17 20:56:13 +09:00
parent 2f5ca1af83
commit 5fd619eea7

View File

@ -18,6 +18,7 @@ import (
"fmt" "fmt"
"image" "image"
"image/color" "image/color"
"math"
"unsafe" "unsafe"
"github.com/hajimehoshi/ebiten/v2/internal/affine" "github.com/hajimehoshi/ebiten/v2/internal/affine"
@ -106,7 +107,7 @@ func canSkipMipmap(geom GeoM, filter builtinshader.Filter) bool {
if filter != builtinshader.FilterLinear { if filter != builtinshader.FilterLinear {
return true return true
} }
return geom.det2x2() >= 0.999 return math.Abs(geom.det2x2()) >= 0.999
} }
// DrawImageOptions represents options for DrawImage. // DrawImageOptions represents options for DrawImage.