Lines 1-22
Link Here
|
1 |
--- apps/pdfapp.c.orig 2011-04-29 14:06:09.000000000 -0500 |
1 |
--- apps/pdfapp.c.orig 2012-03-29 05:46:53.000000000 -0500 |
2 |
+++ apps/pdfapp.c 2011-05-16 19:58:55.650380651 -0500 |
2 |
+++ apps/pdfapp.c 2012-04-07 16:43:55.030462608 -0500 |
3 |
@@ -777,11 +777,15 @@ void pdfapp_onkey(pdfapp_t *app, int c) |
3 |
@@ -774,11 +774,15 @@ void pdfapp_onkey(pdfapp_t *app, int c) |
4 |
break; |
4 |
break; |
5 |
|
5 |
|
6 |
case 'j': |
6 |
case 'j': |
7 |
+ if (app->pany + app->image->h <= app->winh) |
7 |
+ if (app->pany + fz_pixmap_height(app->ctx, app->image) <= app->winh) |
8 |
+ goto pagedown; |
8 |
+ goto pagedown; |
9 |
app->pany -= app->image->h / 10; |
9 |
app->pany -= fz_pixmap_height(app->ctx, app->image) / 10; |
10 |
pdfapp_showpage(app, 0, 0, 1); |
10 |
pdfapp_showpage(app, 0, 0, 1); |
11 |
break; |
11 |
break; |
12 |
|
12 |
|
13 |
case 'k': |
13 |
case 'k': |
14 |
+ if (app->pany >= 0) |
14 |
+ if (app->pany >= 0) |
15 |
+ goto pageup; |
15 |
+ goto pageup; |
16 |
app->pany += app->image->h / 10; |
16 |
app->pany += fz_pixmap_height(app->ctx, app->image) / 10; |
17 |
pdfapp_showpage(app, 0, 0, 1); |
17 |
pdfapp_showpage(app, 0, 0, 1); |
18 |
break; |
18 |
break; |
19 |
@@ -843,6 +847,7 @@ void pdfapp_onkey(pdfapp_t *app, int c) |
19 |
@@ -842,6 +846,7 @@ void pdfapp_onkey(pdfapp_t *app, int c) |
20 |
*/ |
20 |
*/ |
21 |
|
21 |
|
22 |
case ',': |
22 |
case ',': |
Lines 24-30
Link Here
|
24 |
panto = PAN_TO_BOTTOM; |
24 |
panto = PAN_TO_BOTTOM; |
25 |
if (app->numberlen > 0) |
25 |
if (app->numberlen > 0) |
26 |
app->pageno -= atoi(app->number); |
26 |
app->pageno -= atoi(app->number); |
27 |
@@ -851,6 +856,7 @@ void pdfapp_onkey(pdfapp_t *app, int c) |
27 |
@@ -850,6 +855,7 @@ void pdfapp_onkey(pdfapp_t *app, int c) |
28 |
break; |
28 |
break; |
29 |
|
29 |
|
30 |
case '.': |
30 |
case '.': |
Lines 32-42
Link Here
|
32 |
panto = PAN_TO_TOP; |
32 |
panto = PAN_TO_TOP; |
33 |
if (app->numberlen > 0) |
33 |
if (app->numberlen > 0) |
34 |
app->pageno += atoi(app->number); |
34 |
app->pageno += atoi(app->number); |
35 |
@@ -1022,6 +1028,11 @@ void pdfapp_onmouse(pdfapp_t *app, int x |
35 |
@@ -1039,6 +1045,12 @@ void pdfapp_onmouse(pdfapp_t *app, int x |
36 |
int isx = (modifiers & (1<<0)); |
36 |
int isx = (modifiers & (1<<0)); |
37 |
int xstep = isx ? 20 * dir : 0; |
37 |
int xstep = isx ? 20 * dir : 0; |
38 |
int ystep = !isx ? 20 * dir : 0; |
38 |
int ystep = !isx ? 20 * dir : 0; |
39 |
+ if (!isx && dir < 0 && app->pany + app->image->h <= app->winh) |
39 |
+ if (!isx && dir < 0 && app->pany + |
|
|
40 |
+ fz_pixmap_height(app->ctx, app->image) <= app->winh) |
40 |
+ pdfapp_onkey(app, 'j'); |
41 |
+ pdfapp_onkey(app, 'j'); |
41 |
+ else if (!isx && dir > 0 && app->pany >= 0) |
42 |
+ else if (!isx && dir > 0 && app->pany >= 0) |
42 |
+ pdfapp_onkey(app, 'k'); |
43 |
+ pdfapp_onkey(app, 'k'); |