aboutsummaryrefslogtreecommitdiffstats
path: root/image.c
diff options
context:
space:
mode:
authorexplosion-mental <explosion-mental@noreply.codeberg.org>2022-08-16 10:54:31 +0200
committerNRK <nrk@disroot.org>2022-08-16 10:54:31 +0200
commit0f0c49a630285af10c765e0b724896ff281e7b66 (patch)
tree96ba66a1ff64cd89c2fd75f8f0d736aa34fc3c56 /image.c
parent6578e6eb6533a6651bd88ecae7720aced88c8c2f (diff)
downloadnsxiv-0f0c49a630285af10c765e0b724896ff281e7b66.tar.zst
code-style: don't indent switch cases (#358)
The suckless coding style [^0] and the linux coding style [^1] both recommends not indenting switch cases. And it helps out people with lower resolution monitors. [^0]: https://suckless.org/coding_style/ [^1]: https://www.kernel.org/doc/html/v5.10/process/coding-style.html#indentation Co-authored-by: explosion-mental <explosion0mental@gmail.com> Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/358 Reviewed-by: NRK <nrk@disroot.org> Co-authored-by: explosion-mental <explosion-mental@noreply.codeberg.org> Co-committed-by: explosion-mental <explosion-mental@noreply.codeberg.org>
Diffstat (limited to 'image.c')
-rw-r--r--image.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/image.c b/image.c
index ad2a254..ab95232 100644
--- a/image.c
+++ b/image.c
@@ -111,27 +111,27 @@ void exif_auto_orientate(const fileinfo_t *file)
exif_data_unref(ed);
switch (orientation) {
- case 5:
- imlib_image_orientate(1);
- /* fall through */
- case 2:
- imlib_image_flip_vertical();
- break;
- case 3:
- imlib_image_orientate(2);
- break;
- case 7:
- imlib_image_orientate(1);
- /* fall through */
- case 4:
- imlib_image_flip_horizontal();
- break;
- case 6:
- imlib_image_orientate(1);
- break;
- case 8:
- imlib_image_orientate(3);
- break;
+ case 5:
+ imlib_image_orientate(1);
+ /* fall through */
+ case 2:
+ imlib_image_flip_vertical();
+ break;
+ case 3:
+ imlib_image_orientate(2);
+ break;
+ case 7:
+ imlib_image_orientate(1);
+ /* fall through */
+ case 4:
+ imlib_image_flip_horizontal();
+ break;
+ case 6:
+ imlib_image_orientate(1);
+ break;
+ case 8:
+ imlib_image_orientate(3);
+ break;
}
}
#endif
@@ -531,18 +531,18 @@ static bool img_fit(img_t *img)
zh = (float) img->win->h / (float) img->h;
switch (img->scalemode) {
- case SCALE_FILL:
- z = MAX(zw, zh);
- break;
- case SCALE_WIDTH:
- z = zw;
- break;
- case SCALE_HEIGHT:
- z = zh;
- break;
- default:
- z = MIN(zw, zh);
- break;
+ case SCALE_FILL:
+ z = MAX(zw, zh);
+ break;
+ case SCALE_WIDTH:
+ z = zw;
+ break;
+ case SCALE_HEIGHT:
+ z = zh;
+ break;
+ default:
+ z = MIN(zw, zh);
+ break;
}
z = MIN(z, img->scalemode == SCALE_DOWN ? 1.0 : ZOOM_MAX);
@@ -741,14 +741,14 @@ bool img_pan(img_t *img, direction_t dir, int d)
}
switch (dir) {
- case DIR_LEFT:
- return img_move(img, x, 0.0);
- case DIR_RIGHT:
- return img_move(img, -x, 0.0);
- case DIR_UP:
- return img_move(img, 0.0, y);
- case DIR_DOWN:
- return img_move(img, 0.0, -y);
+ case DIR_LEFT:
+ return img_move(img, x, 0.0);
+ case DIR_RIGHT:
+ return img_move(img, -x, 0.0);
+ case DIR_UP:
+ return img_move(img, 0.0, y);
+ case DIR_DOWN:
+ return img_move(img, 0.0, -y);
}
return false;
}