Krolyxon
Commit ec545a6

Branches

Refs →

nsxivec545a6

Make pan fraction configurable

Author
jcalve
Date
2017-07-23 02:15 +0200
Committer
Bert Münnich · 2017-09-06 19:39 +0200
Parent
30e9ec8
Commit
ec545a6b6c3339edfd0536a2af4cb7e91888285f

+6 −3

2 files changed

  1. M config.def.h +3 −0
  2. M image.c +3 −3
M config.def.h View
@@ -40,6 +40,9 @@ enum { SLIDESHOW_DELAY = 5 };
4040 static const double GAMMA_MAX = 10.0;
4141 static const int GAMMA_RANGE = 32;
4242
43+/* command i_scroll pans image 1/PAN_FRACTION of screen width/height */
44+static const int PAN_FRACTION = 5;
45+
4346 /* if false, pixelate images at zoom level != 100%,
4447 * toggled with 'a' key binding
4548 */
M image.c View
@@ -590,7 +590,7 @@ bool img_move(img_t *img, float dx, float dy)
590590 bool img_pan(img_t *img, direction_t dir, int d)
591591 {
592592 /* d < 0: screen-wise
593− * d = 0: 1/5 of screen
593+ * d = 0: 1/PAN_FRACTION of screen
594594 * d > 0: num of pixels
595595 */
596596 float x, y;
@@ -598,8 +598,8 @@ bool img_pan(img_t *img, direction_t dir, int d)
598598 if (d > 0) {
599599 x = y = MAX(1, (float) d * img->zoom);
600600 } else {
601− x = img->win->w / (d < 0 ? 1 : 5);
602− y = img->win->h / (d < 0 ? 1 : 5);
601+ x = img->win->w / (d < 0 ? 1 : PAN_FRACTION);
602+ y = img->win->h / (d < 0 ? 1 : PAN_FRACTION);
603603 }
604604
605605 switch (dir) {