fbpdf: retain vertical position after zooming
authorAli Gholami Rudi <ali@rudi.ir>
Sun, 6 May 2012 16:47:33 +0000 (6 21:17 +0430)
committerAli Gholami Rudi <ali@rudi.ir>
Sun, 6 May 2012 16:47:33 +0000 (6 21:17 +0430)
fbpdf.c

diff --git a/fbpdf.c b/fbpdf.c
index 7ef8113..9da3f8b 100644 (file)
--- a/fbpdf.c
+++ b/fbpdf.c
@@ -113,6 +113,7 @@ static void mainloop(void)
        int step = fb_rows() / PAGESTEPS;
        int hstep = fb_cols() / PAGESTEPS;
        int c, c2;
+       int _zoom;
        term_setup();
        signal(SIGCONT, sigcont);
        showpage(num, 0);
@@ -132,8 +133,9 @@ static void mainloop(void)
                        showpage(getcount(doc_pages(doc)), 0);
                        break;
                case 'z':
+                       _zoom = zoom;
                        zoom = getcount(15);
-                       showpage(num, 0);
+                       showpage(num, head * zoom / _zoom);
                        break;
                case 'r':
                        rotate = getcount(0);