aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index bcc6a58..c1f2b72 100644
--- a/main.c
+++ b/main.c
@@ -368,8 +368,8 @@ void on_keypress(XKeyEvent *kev) {
/* control window */
case XK_W:
- x = win.x + img.x;
- y = win.y + img.y;
+ x = MAX(0, win.x + img.x);
+ y = MAX(0, win.y + img.y);
w = img.w * img.zoom;
h = img.h * img.zoom;
if ((changed = win_moveresize(&win, x, y, w, h))) {