summaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
authorBert Münnich <be.muennich@gmail.com>2013-08-10 15:55:18 +0200
committerBert Münnich <be.muennich@gmail.com>2013-08-10 15:55:18 +0200
commit56142bd3bafedf51882b368ab08a580ac98f2619 (patch)
tree5224012a224fe3526105031c07595f9b236b1f70 /commands.c
parent7e51c35801f9921685c3acf0d1d17d9370ae4d59 (diff)
downloadnsxiv-56142bd3bafedf51882b368ab08a580ac98f2619.tar.zst
Refactored merged rotation code
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/commands.c b/commands.c
index ae8dac2..36da023 100644
--- a/commands.c
+++ b/commands.c
@@ -397,21 +397,14 @@ bool i_fit_to_img(arg_t a)
bool i_rotate(arg_t a)
{
- rotate_t rot = (rotate_t) a;
+ degree_t degree = (degree_t) a;
if (mode == MODE_IMAGE) {
- if (rot == ROTATE_90) {
- img_rotate(&img, 1);
- return true;
- } else if (rot == ROTATE_270) {
- img_rotate(&img, 3);
- return true;
- } else if (rot == ROTATE_180) {
- img_rotate(&img, 2);
- return true;
- }
+ img_rotate(&img, degree);
+ return true;
+ } else {
+ return false;
}
- return false;
}
bool i_flip(arg_t a)