examples/windowsize: Bug fix: screen size must be positive

This commit is contained in:
Hajime Hoshi 2016-03-23 00:45:58 +09:00
parent 62dffe5405
commit 2beba60530

View File

@ -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
}
}