mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
examples/windowsize: Bug fix: screen size must be positive
This commit is contained in:
parent
62dffe5405
commit
2beba60530
@ -62,12 +62,12 @@ func update(screen *ebiten.Image) error {
|
||||
screenHeight += d
|
||||
}
|
||||
if keyStates[ebiten.KeyDown] == 1 {
|
||||
if 16 < screenHeight {
|
||||
if 16 < screenHeight && d < screenHeight {
|
||||
screenHeight -= d
|
||||
}
|
||||
}
|
||||
if keyStates[ebiten.KeyLeft] == 1 {
|
||||
if 16 < screenWidth {
|
||||
if 16 < screenWidth && d < screenWidth {
|
||||
screenWidth -= d
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user