From 09335fdc1404de66849ee0232596978e9f234490 Mon Sep 17 00:00:00 2001
From: Bert <ber.t@gmx.com>
Date: Sat, 19 Feb 2011 22:53:22 +0100
Subject: [PATCH] Fixed offsets in resize win to image

---
 Makefile | 2 +-
 main.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 1a6c8a4..d4bcf95 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 all: sxiv
 
-VERSION=git-20110217
+VERSION=git-20110219
 
 CC?=gcc
 PREFIX?=/usr/local
diff --git a/main.c b/main.c
index 5bd7b75..6828795 100644
--- a/main.c
+++ b/main.c
@@ -344,8 +344,8 @@ void on_keypress(XKeyEvent *kev) {
 			/* render on next configurenotify */
 			break;
 		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))) {