summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-05-08 21:57:36 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-05-08 21:57:36 +0200
commit01d96e16f6217a7eafb3079a378daa40f3cd34c8 (patch)
tree9ad54f2d352a4e6c6158edefcffae6ca199c6752
parent08ae0e4887d9aa2ff37e4fc4d56ca514c7f6bd85 (diff)
rename --zoom-rate to --zoom-step and switch to percent
This is consistent with --scroll-step (option name) and --zoom (percentage)
-rw-r--r--man/feh.pre6
-rw-r--r--src/options.c12
-rw-r--r--src/options.h2
3 files changed, 10 insertions, 10 deletions
diff --git a/man/feh.pre b/man/feh.pre
index c27077a..8be5a6f 100644
--- a/man/feh.pre
+++ b/man/feh.pre
@@ -988,11 +988,11 @@ zoom the image like the
.Cm --bg-fill
mode.
.
-.It Cm --zoom-rate Ar ratio
+.It Cm --zoom-step Ar percent
.
Zoom images in and out by
-.Ar ratio
-.Pq default: 1.25
+.Ar percent
+.Pq default: 25
when using the zoom keys and buttons.
.
.El
diff --git a/src/options.c b/src/options.c
index 1a89d5b..a77c163 100644
--- a/src/options.c
+++ b/src/options.c
@@ -395,7 +395,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
{"bg-center" , 0, 0, OPTION_bg_center},
{"bg-scale" , 0, 0, OPTION_bg_scale},
{"zoom" , 1, 0, OPTION_zoom},
- {"zoom-rate" , 1, 0, OPTION_zoom_rate},
+ {"zoom-step" , 1, 0, OPTION_zoom_step},
{"no-screen-clip", 0, 0, OPTION_no_screen_clip},
{"index-info" , 1, 0, OPTION_index_info},
{"magick-timeout", 1, 0, OPTION_magick_timeout},
@@ -840,13 +840,13 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
case OPTION_window_id:
opt.x11_windowid = atol(optarg);
break;
- case OPTION_zoom_rate:
+ case OPTION_zoom_step:
opt.zoom_rate = atof(optarg);
- if ((opt.zoom_rate <= 0.0) || (opt.zoom_rate == 1.0)) {
- weprintf("Zooming disabled due to --zoom-rate=%f", opt.zoom_rate);
+ if ((opt.zoom_rate <= 0)) {
+ weprintf("Zooming disabled due to --zoom-step=%f", opt.zoom_rate);
opt.zoom_rate = 1.0;
- } else if (opt.zoom_rate < 1.0) {
- opt.zoom_rate = 1.0 / opt.zoom_rate;
+ } else {
+ opt.zoom_rate = 1 + ((float)opt.zoom_rate / 100);
}
break;
default:
diff --git a/src/options.h b/src/options.h
index ea76b24..6441e8b 100644
--- a/src/options.h
+++ b/src/options.h
@@ -216,7 +216,7 @@ OPTION_bg_scale,
OPTION_bg_fill,
OPTION_bg_max,
OPTION_zoom,
-OPTION_zoom_rate,
+OPTION_zoom_step,
OPTION_zoom_in_rate,
OPTION_zoom_out_rate,
OPTION_keep_zoom_vp,