updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / mupdf-patched / scroll_hack.patch
blob506ed52bcec49d24585067e915b8f275e6086ee7
1 diff -crB mupdf-0.9-original/apps/pdfapp.c mupdf-0.9-patched/apps/pdfapp.c
2 *** mupdf-0.9-original/apps/pdfapp.c 2011-09-05 13:55:39.000000000 +0200
3 --- mupdf-0.9-patched/apps/pdfapp.c 2011-09-11 02:10:32.528932823 +0200
4 ***************
5 *** 803,813 ****
6 --- 803,817 ----
7 break;
9 case 'j':
10 + if (app->pany + app->image->h <= app->winh)
11 + goto pagedown;
12 app->pany -= app->image->h / 10;
13 pdfapp_showpage(app, 0, 0, 1);
14 break;
16 case 'k':
17 + if (app->pany >= 0)
18 + goto pageup;
19 app->pany += app->image->h / 10;
20 pdfapp_showpage(app, 0, 0, 1);
21 break;
22 ***************
23 *** 871,876 ****
24 --- 875,881 ----
27 case ',':
28 + pageup:
29 panto = PAN_TO_BOTTOM;
30 if (app->numberlen > 0)
31 app->pageno -= atoi(app->number);
32 ***************
33 *** 879,884 ****
34 --- 884,890 ----
35 break;
37 case '.':
38 + pagedown:
39 panto = PAN_TO_TOP;
40 if (app->numberlen > 0)
41 app->pageno += atoi(app->number);
42 ***************
43 *** 887,893 ****
44 break;
46 case 'b':
47 ! panto = DONT_PAN;
48 if (app->numberlen > 0)
49 app->pageno -= atoi(app->number);
50 else
51 --- 893,899 ----
52 break;
54 case 'b':
55 ! panto = PAN_TO_TOP;
56 if (app->numberlen > 0)
57 app->pageno -= atoi(app->number);
58 else
59 ***************
60 *** 895,901 ****
61 break;
63 case ' ':
64 ! panto = DONT_PAN;
65 if (app->numberlen > 0)
66 app->pageno += atoi(app->number);
67 else
68 --- 901,907 ----
69 break;
71 case ' ':
72 ! panto = PAN_TO_TOP;
73 if (app->numberlen > 0)
74 app->pageno += atoi(app->number);
75 else
76 ***************
77 *** 1051,1057 ****
78 int isx = (modifiers & (1<<0));
79 int xstep = isx ? 20 * dir : 0;
80 int ystep = !isx ? 20 * dir : 0;
81 ! pdfapp_panview(app, app->panx + xstep, app->pany + ystep);
85 --- 1057,1069 ----
86 int isx = (modifiers & (1<<0));
87 int xstep = isx ? 20 * dir : 0;
88 int ystep = !isx ? 20 * dir : 0;
90 ! if (!isx && dir < 0 && app->pany + app->image->h <= app->winh)
91 ! pdfapp_onkey(app, 'j');
92 ! else if (!isx && dir > 0 && app->pany >= 0)
93 ! pdfapp_onkey(app, 'k');
94 ! else
95 ! pdfapp_panview(app, app->panx + xstep, app->pany + ystep);