From 112b3fbcd8509bc3e198ed7e982373127e2e68b9 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 18 Nov 2014 11:44:59 +0100 Subject: add global scale (textreading) --- fbi.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'fbi.c') diff --git a/fbi.c b/fbi.c index 5fdaa36..95290d0 100644 --- a/fbi.c +++ b/fbi.c @@ -136,6 +136,7 @@ static float fbgamma = 1; /* Command line options. */ int autodown; int autoup; +int autoonce; int comments; int transparency = 40; int timeout; @@ -150,6 +151,9 @@ int perfmon = 0; static char *fontname = NULL; static FT_Face face; +/* scaling */ +static float globalscale = 0; + /* ---------------------------------------------------------------------- */ /* fwd declarations */ @@ -1343,6 +1347,7 @@ static void flist_img_scale(struct flist *f, float scale, int prefetch) } } f->scale = scale; + globalscale = scale; } static void flist_img_load(struct flist *f, int prefetch) @@ -1370,7 +1375,9 @@ static void flist_img_load(struct flist *f, int prefetch) if (!f->seen) { scale = 1; - if (autoup || autodown) { + if (autoonce && globalscale != 0) { + scale = globalscale; + } else if (autoup || autodown) { scale = auto_scale(f->fimg); if (scale < 1 && !autodown) scale = 1; @@ -1454,6 +1461,7 @@ main(int argc, char *argv[]) once = GET_ONCE(); autoup = GET_AUTO_UP(); autodown = GET_AUTO_DOWN(); + autoonce = GET_AUTO_ONCE(); fitwidth = GET_FIT_WIDTH(); statusline = GET_VERBOSE(); textreading = GET_TEXT_MODE(); -- cgit