Skip to content

Commit

Permalink
internal/ui: bug fix: skipCount should be reset when the outside size…
Browse files Browse the repository at this point in the history
… changes

Closes #3101
  • Loading branch information
hajimehoshi committed Sep 16, 2024
1 parent d309085 commit 50f0a83
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/ui/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

1 comment on commit 50f0a83

@hajimehoshi
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closes #3101

This is typo. The correct issue is #3105

Please sign in to comment.