diff options
author | Stéphane Aulery <saulery@free.fr> | 2014-10-30 17:11:03 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2014-11-03 12:08:43 +0100 |
commit | 23c8b7ec69c2add760a186ec2c1602b3e4662197 (patch) | |
tree | 3619fd6e63df3bcd5129ee78d61637c8abe753ed /fbi.c | |
parent | 2d58656d29d55f11854255b10ce8e86f49d46cec (diff) | |
download | fbida-23c8b7ec69c2add760a186ec2c1602b3e4662197.tar.gz |
Fix scrolling when the -T and -a options are activated together to read a pdf and we zoom in on a page.
Scrolling was blocked after zooming in on a page when using the -T and -a
options together (Debian bug #512387).
Signed-off-by: Stéphane Aulery <saulery@free.fr>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'fbi.c')
-rw-r--r-- | fbi.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -768,6 +768,13 @@ static float auto_scale(struct ida_image *img) return scale; } +static int calculate_text_steps(int height, int yres) +{ + int pages = ceil((float)height / yres); + int text_steps = ceil((float)height / pages); + return text_steps; +} + /* ---------------------------------------------------------------------- */ static void effect_blend(struct flist *f, struct flist *t) @@ -1069,6 +1076,10 @@ static void scale_fix_top_left(struct flist *f, float old, float new) height = img->i.height * new; f->left = cx * width - fb_var.xres/2; f->top = cy * height - fb_var.yres/2; + + if (textreading) { + f->text_steps = calculate_text_steps(height, fb_var.yres); + } } /* ---------------------------------------------------------------------- */ @@ -1378,8 +1389,7 @@ static void flist_img_load(struct flist *f, int prefetch) if (img->i.height > fb_var.yres) { f->top = (img->i.height - fb_var.yres) / 2; if (textreading) { - int pages = ceil((float)img->i.height / fb_var.yres); - f->text_steps = ceil((float)img->i.height / pages); + f->text_steps = calculate_text_steps(img->i.height, fb_var.yres); f->top = 0; } } |