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