internal/ui: bug fix: skipCount should be reset when the outside size changes

Closes #3101
This commit is contained in:
Hajime Hoshi 2024-09-17 00:57:02 +09:00
parent d30908522a
commit 50f0a8343c

View File

@ -246,8 +246,13 @@ func (c *context) layoutGame(outsideWidth, outsideHeight float64, deviceScaleFac
panic("ui: Layout must return positive numbers")
}
c.screenWidth = outsideWidth * deviceScaleFactor
c.screenHeight = outsideHeight * deviceScaleFactor
screenWidth := outsideWidth * deviceScaleFactor
screenHeight := outsideHeight * deviceScaleFactor
if c.screenWidth != screenWidth || c.screenHeight != screenHeight {
c.skipCount = 0
}
c.screenWidth = screenWidth
c.screenHeight = screenHeight
c.offscreenWidth = owf
c.offscreenHeight = ohf