nsxivec545a6
Make pan fraction configurable
+6 −3
2 files changed
- M config.def.h +3 −0
- M image.c +3 −3
| @@ -40,6 +40,9 @@ enum { SLIDESHOW_DELAY = 5 }; | |||
| 40 | 40 | static const double GAMMA_MAX = 10.0; | |
| 41 | 41 | static const int GAMMA_RANGE = 32; | |
| 42 | 42 | ||
| 43 | + | /* command i_scroll pans image 1/PAN_FRACTION of screen width/height */ | |
| 44 | + | static const int PAN_FRACTION = 5; | |
| 45 | + | ||
| 43 | 46 | /* if false, pixelate images at zoom level != 100%, | |
| 44 | 47 | * toggled with 'a' key binding | |
| 45 | 48 | */ | |
| @@ -590,7 +590,7 @@ bool img_move(img_t *img, float dx, float dy) | |||
| 590 | 590 | bool img_pan(img_t *img, direction_t dir, int d) | |
| 591 | 591 | { | |
| 592 | 592 | /* d < 0: screen-wise | |
| 593 | − | * d = 0: 1/5 of screen | |
| 593 | + | * d = 0: 1/PAN_FRACTION of screen | |
| 594 | 594 | * d > 0: num of pixels | |
| 595 | 595 | */ | |
| 596 | 596 | float x, y; | |
| @@ -598,8 +598,8 @@ bool img_pan(img_t *img, direction_t dir, int d) | |||
| 598 | 598 | if (d > 0) { | |
| 599 | 599 | x = y = MAX(1, (float) d * img->zoom); | |
| 600 | 600 | } 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); | |
| 603 | 603 | } | |
| 604 | 604 | ||
| 605 | 605 | switch (dir) { | |