diff options
author | Bert Münnich <ber.t@posteo.de> | 2014-07-23 23:41:23 +0200 |
---|---|---|
committer | Bert Münnich <ber.t@posteo.de> | 2014-07-23 23:41:23 +0200 |
commit | 9c92de858484b6bbe90252955bef5f77a80f3c45 (patch) | |
tree | 6cc5e92a83f29e3082848e41ee8bd981e80f3b3f /image.c | |
parent | 06164c29b759c3e21e79be03b285bdf3da6f5a25 (diff) | |
download | nsxiv-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.c | 22 |
1 files changed, 8 insertions, 14 deletions
@@ -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); |