diff options
author | Sebastian Neuser <haggl@sineband.de> | 2013-08-14 00:39:05 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2014-05-27 14:43:06 +0200 |
commit | c357c281a6dde7ec9a2d265237a2790a7e1ed306 (patch) | |
tree | 3dfbce9fbd1c8031a4d8be11453955c91f405da1 | |
parent | a65d4da6b8073a67c69f3c716152a7072770db40 (diff) | |
download | mupdf-c357c281a6dde7ec9a2d265237a2790a7e1ed306.tar.xz |
Fix 694518: Implement continuous scrolling with keyboard.
-rw-r--r-- | platform/x11/pdfapp.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c index de5ce743..118490aa 100644 --- a/platform/x11/pdfapp.c +++ b/platform/x11/pdfapp.c @@ -1156,14 +1156,36 @@ void pdfapp_onkey(pdfapp_t *app, int c) break; case 'j': - app->pany -= fz_pixmap_height(app->ctx, app->image) / 10; - pdfapp_showpage(app, 0, 0, 1, 0, 0); - break; + { + int h = fz_pixmap_height(app->ctx, app->image); + if (h <= app->winh || app->pany <= app->winh - h) + { + panto = PAN_TO_TOP; + app->pageno++; + } + else + { + app->pany -= h / 10; + pdfapp_showpage(app, 0, 0, 1, 0, 0); + } + break; + } case 'k': - app->pany += fz_pixmap_height(app->ctx, app->image) / 10; - pdfapp_showpage(app, 0, 0, 1, 0, 0); - break; + { + int h = fz_pixmap_height(app->ctx, app->image); + if (h <= app->winh || app->pany == 0) + { + panto = PAN_TO_BOTTOM; + app->pageno--; + } + else + { + app->pany += h / 10; + pdfapp_showpage(app, 0, 0, 1, 0, 0); + } + break; + } case 'l': app->panx -= fz_pixmap_width(app->ctx, app->image) / 10; |