You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-text/mupdf/files/mupdf-0.9-scroll_hack.patch

69 lines
1.5 KiB

From http://aur.archlinux.org/packages.php?ID=52333
--- mupdf-0.9/apps/pdfapp.c
+++ mupdf-0.9/apps/pdfapp.c
@@ -817,11 +817,15 @@
break;
case 'j':
+ if (app->pany + app->image->h <= app->winh)
+ goto pagedown;
app->pany -= app->image->h / 10;
pdfapp_showpage(app, 0, 0, 1);
break;
case 'k':
+ if (app->pany >= 0)
+ goto pageup;
app->pany += app->image->h / 10;
pdfapp_showpage(app, 0, 0, 1);
break;
@@ -885,6 +889,7 @@
*/
case ',':
+ pageup:
panto = PAN_TO_BOTTOM;
if (app->numberlen > 0)
app->pageno -= atoi(app->number);
@@ -893,6 +898,7 @@
break;
case '.':
+ pagedown:
panto = PAN_TO_TOP;
if (app->numberlen > 0)
app->pageno += atoi(app->number);
@@ -902,7 +908,7 @@
case 'b':
case '\b': //backspace
- panto = DONT_PAN;
+ panto = PAN_TO_TOP;
if (app->numberlen > 0)
app->pageno -= atoi(app->number);
else
@@ -911,7 +917,7 @@
case ' ':
case 'f':
- panto = DONT_PAN;
+ panto = PAN_TO_TOP;
if (app->numberlen > 0)
app->pageno += atoi(app->number);
else
@@ -1067,7 +1073,12 @@
int isx = (modifiers & (1<<0));
int xstep = isx ? 20 * dir : 0;
int ystep = !isx ? 20 * dir : 0;
- pdfapp_panview(app, app->panx + xstep, app->pany + ystep);
+ if (!isx && dir < 0 && app->pany + app->image->h <= app->winh)
+ pdfapp_onkey(app, 'j');
+ else if (!isx && dir > 0 && app->pany >= 0)
+ pdfapp_onkey(app, 'k');
+ else
+ pdfapp_panview(app, app->panx + xstep, app->pany + ystep);
}
}
}