diff --git a/internal/mipmap/mipmap.go b/internal/mipmap/mipmap.go index 5079f4c6a..c0a6d08d1 100644 --- a/internal/mipmap/mipmap.go +++ b/internal/mipmap/mipmap.go @@ -108,7 +108,7 @@ func (m *Mipmap) DrawImage(src *Mipmap, bounds image.Rectangle, geom GeoM, color return } - level := src.mipmapLevel(geom, bounds.Dx(), bounds.Dy(), filter) + level := src.mipmapLevel(geom, filter) if level > 0 { // If the image can be scaled into 0 size, adjust the level. (#839) @@ -312,7 +312,7 @@ func (m *Mipmap) disposeMipmaps() { // mipmapLevel returns an appropriate mipmap level for the given determinant of a geometry matrix. // // mipmapLevel panics if det is NaN or 0. -func (m *Mipmap) mipmapLevel(geom GeoM, width, height int, filter driver.Filter) int { +func (m *Mipmap) mipmapLevel(geom GeoM, filter driver.Filter) int { det := geom.det() if math.IsNaN(float64(det)) { panic("ebiten: det must be finite at mipmapLevel") @@ -338,7 +338,7 @@ func (m *Mipmap) mipmapLevel(geom GeoM, width, height int, filter driver.Filter) } const mipmapMaxSize = 1024 - w, h := width, height + w, h := m.width, m.height if w >= mipmapMaxSize || h >= mipmapMaxSize { return 0 }