mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ebiten: Refactoring: canSkipMipmap
This commit is contained in:
parent
fa53160e18
commit
9464dc2f58
8
image.go
8
image.go
@ -88,14 +88,10 @@ func (i *Image) Fill(clr color.Color) {
|
||||
}
|
||||
|
||||
func canSkipMipmap(geom GeoM, filter driver.Filter) bool {
|
||||
det := geom.det2x2()
|
||||
if filter == driver.FilterNearest && det <= 1.001 {
|
||||
if filter != driver.FilterLinear {
|
||||
return true
|
||||
}
|
||||
if filter == driver.FilterLinear && det >= 0.999 {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return geom.det2x2() >= 0.999
|
||||
}
|
||||
|
||||
// DrawImageOptions represents options for DrawImage.
|
||||
|
Loading…
Reference in New Issue
Block a user