mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-28 19:52:43 +01:00
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:
parent
2f5ca1af83
commit
5fd619eea7
3
image.go
3
image.go
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user