From 2beba605306dbbf5339c52432282ca339bc93acc Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 23 Mar 2016 00:45:58 +0900 Subject: [PATCH] examples/windowsize: Bug fix: screen size must be positive --- examples/windowsize/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/windowsize/main.go b/examples/windowsize/main.go index dd773f47e..3a8f379da 100644 --- a/examples/windowsize/main.go +++ b/examples/windowsize/main.go @@ -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 } }