diff options
Diffstat (limited to 'apps/pdfapp.c')
-rw-r--r-- | apps/pdfapp.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/pdfapp.c b/apps/pdfapp.c index 881c4eb1..217a3346 100644 --- a/apps/pdfapp.c +++ b/apps/pdfapp.c @@ -50,6 +50,8 @@ char *pdfapp_usage(pdfapp_t *app) "l\t\t-- scroll right\n" "+\t\t-- zoom in\n" "-\t\t-- zoom out\n" + "W\t\t-- zoom to fit window width\n" + "H\t\t-- zoom to fit window height\n" "w\t\t-- shrinkwrap\n" "r\t\t-- reload file\n" ". pgdn right space\t-- next page\n" @@ -695,6 +697,23 @@ void pdfapp_onkey(pdfapp_t *app, int c) pdfapp_showpage(app, 0, 1, 1); break; + case 'W': + app->resolution *= (double) app->winw / (double) fz_pixmap_width(app->ctx, app->image); + if (app->resolution > MAXRES) + app->resolution = MAXRES; + else if (app->resolution < MINRES) + app->resolution = MINRES; + pdfapp_showpage(app, 0, 1, 1); + break; + case 'H': + app->resolution *= (double) app->winh / (double) fz_pixmap_height(app->ctx, app->image); + if (app->resolution > MAXRES) + app->resolution = MAXRES; + else if (app->resolution < MINRES) + app->resolution = MINRES; + pdfapp_showpage(app, 0, 1, 1); + break; + case 'L': app->rotate -= 90; pdfapp_showpage(app, 0, 1, 1); |