mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-13 04:22:05 +01:00
mipmap: Bug fix: Infinite loop at (*Mipmap).mipmapLevelFromDistance
This commit is contained in:
parent
bf56492d2d
commit
c4c9771b78
@ -267,6 +267,9 @@ func (m *Mipmap) mipmapLevelFromDistance(dx0, dy0, dx1, dy1, sx0, sy0, sx1, sy1
|
|||||||
|
|
||||||
d := (dx1-dx0)*(dx1-dx0) + (dy1-dy0)*(dy1-dy0)
|
d := (dx1-dx0)*(dx1-dx0) + (dy1-dy0)*(dy1-dy0)
|
||||||
s := (sx1-sx0)*(sx1-sx0) + (sy1-sy0)*(sy1-sy0)
|
s := (sx1-sx0)*(sx1-sx0) + (sy1-sy0)*(sy1-sy0)
|
||||||
|
if s == 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
scale := d / s
|
scale := d / s
|
||||||
|
|
||||||
// Use 'negative' mipmap to render edges correctly (#611, #907).
|
// Use 'negative' mipmap to render edges correctly (#611, #907).
|
||||||
|
Loading…
Reference in New Issue
Block a user