summaryrefslogtreecommitdiffstats
path: root/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'image.c')
-rw-r--r--image.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/image.c b/image.c
index 3230880..b2ac293 100644
--- a/image.c
+++ b/image.c
@@ -663,29 +663,22 @@ void img_rotate(img_t *img, int d)
oy = d == 3 ? img->y : win->h - img->y - img->h * img->zoom;
imlib_context_set_image(img->im);
+ /* rotates by `90 * d` degrees in the clockwise direction */
imlib_image_orientate(d);
- img->x = oy + (win->w - win->h) / 2;
- img->y = ox + (win->h - win->w) / 2;
+ if (d == 1 || d == 3) {
+ img->x = oy + (win->w - win->h) / 2;
+ img->y = ox + (win->h - win->w) / 2;
- tmp = img->w;
- img->w = img->h;
- img->h = tmp;
+ tmp = img->w;
+ img->w = img->h;
+ img->h = tmp;
+ img->checkpan = true;
+ }
- img->checkpan = true;
img->dirty = true;
}
-void img_rotate_left(img_t *img)
-{
- img_rotate(img, 3);
-}
-
-void img_rotate_right(img_t *img)
-{
- img_rotate(img, 1);
-}
-
void img_flip(img_t *img, flipdir_t d)
{
if (img == NULL || img->im == NULL)