diff options
author | Bert <ber.t@gmx.com> | 2011-02-06 17:40:48 +0100 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-02-06 17:40:48 +0100 |
commit | 603e664f7c9fc5cb228eef90fdaa501ac5dfa3bb (patch) | |
tree | b33881b443d0c96e75a2a93d26497dcc5571db27 /main.c | |
parent | cbf6aae721455a952ab0437bb62143ef8444cc93 (diff) | |
download | nsxiv-603e664f7c9fc5cb228eef90fdaa501ac5dfa3bb.tar.zst |
Nicer fit window to image
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -222,6 +222,8 @@ unsigned char timeout; int mox, moy; void on_keypress(XKeyEvent *kev) { + int x, y; + unsigned int w, h; char key; KeySym ksym; int changed; @@ -330,8 +332,14 @@ void on_keypress(XKeyEvent *kev) { /* render on next configurenotify */ break; case XK_W: - if ((changed = win_resize(&win, img.w * img.zoom, img.h * img.zoom))) - img.checkpan = 1; + x = win.x + img.x; + y = win.y + img.y; + w = img.w * img.zoom; + h = img.h * img.zoom; + if ((changed = win_moveresize(&win, x, y, w, h))) { + img.x = x - win.x; + img.y = y - win.y; + } break; /* miscellaneous */ |