summaryrefslogtreecommitdiffstats
path: root/image.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2014-07-23 23:41:23 +0200
committerBert Münnich <ber.t@posteo.de>2014-07-23 23:41:23 +0200
commit9c92de858484b6bbe90252955bef5f77a80f3c45 (patch)
tree6cc5e92a83f29e3082848e41ee8bd981e80f3b3f /image.c
parent06164c29b759c3e21e79be03b285bdf3da6f5a25 (diff)
downloadnsxiv-9c92de858484b6bbe90252955bef5f77a80f3c45.tar.zst
Added support for multiple commands per key/button mapping; elegant fix for issue #150
Diffstat (limited to 'image.c')
-rw-r--r--image.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/image.c b/image.c
index 7312e73..9754e7a 100644
--- a/image.c
+++ b/image.c
@@ -687,20 +687,14 @@ bool img_pan_edge(img_t *img, direction_t dir)
ox = img->x;
oy = img->y;
- switch (dir) {
- case DIR_LEFT:
- img->x = 0;
- break;
- case DIR_RIGHT:
- img->x = img->win->w - img->w * img->zoom;
- break;
- case DIR_UP:
- img->y = 0;
- break;
- case DIR_DOWN:
- img->y = img->win->h - img->h * img->zoom;
- break;
- }
+ if (dir & DIR_LEFT)
+ img->x = 0;
+ if (dir & DIR_RIGHT)
+ img->x = img->win->w - img->w * img->zoom;
+ if (dir & DIR_UP)
+ img->y = 0;
+ if (dir & DIR_DOWN)
+ img->y = img->win->h - img->h * img->zoom;
img_check_pan(img, true);