aboutsummaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
authorBastien Dejean <nihilhill@gmail.com>2013-06-23 16:02:26 +0200
committerBert Münnich <be.muennich@gmail.com>2013-08-10 15:33:14 +0200
commit7e51c35801f9921685c3acf0d1d17d9370ae4d59 (patch)
tree1af111dd3a1a64ed34d3398ae9029036fb50c15f /commands.c
parent68ff9d71f1c9c2e27b2eabea22433f39b7cd98bb (diff)
downloadnsxiv-7e51c35801f9921685c3acf0d1d17d9370ae4d59.tar.zst
Handle 180 degrees image rotation
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/commands.c b/commands.c
index 0ab1944..ae8dac2 100644
--- a/commands.c
+++ b/commands.c
@@ -397,14 +397,17 @@ bool i_fit_to_img(arg_t a)
bool i_rotate(arg_t a)
{
- direction_t dir = (direction_t) a;
+ rotate_t rot = (rotate_t) a;
if (mode == MODE_IMAGE) {
- if (dir == DIR_LEFT) {
- img_rotate_left(&img);
+ if (rot == ROTATE_90) {
+ img_rotate(&img, 1);
+ return true;
+ } else if (rot == ROTATE_270) {
+ img_rotate(&img, 3);
return true;
- } else if (dir == DIR_RIGHT) {
- img_rotate_right(&img);
+ } else if (rot == ROTATE_180) {
+ img_rotate(&img, 2);
return true;
}
}