summaryrefslogtreecommitdiff
path: root/android/jni/mupdf.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2011-07-05 16:52:31 +0100
committerRobin Watts <Robin.Watts@artifex.com>2011-07-05 16:52:31 +0100
commit28e88083d782eba796ec9af2469e57011dc4aa89 (patch)
treed2c0fe21e902cbccf749e1fd7c16e11cf510ef02 /android/jni/mupdf.c
parent84af10f7e17bc8e934c717b92a3c88a02aab1403 (diff)
downloadmupdf-28e88083d782eba796ec9af2469e57011dc4aa89.tar.xz
Fix bug 692276. Android not displaying pdf contents.
The calculation of the translation due to the mediabox/cropbox was wrong on android, causing nothing to be rendered.
Diffstat (limited to 'android/jni/mupdf.c')
-rw-r--r--android/jni/mupdf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/android/jni/mupdf.c b/android/jni/mupdf.c
index f664bc4b..463899af 100644
--- a/android/jni/mupdf.c
+++ b/android/jni/mupdf.c
@@ -179,7 +179,7 @@ Java_com_artifex_mupdf_MuPDFCore_drawPage(JNIEnv *env, jobject thiz, jobject bit
fz_clear_pixmap_with_color(pix, 0xff);
zoom = resolution / 72;
- ctm = fz_translate(0, -currentMediabox.y1);
+ ctm = fz_translate(-currentMediabox.x0, -currentMediabox.y1);
ctm = fz_concat(ctm, fz_scale(zoom, -zoom));
ctm = fz_concat(ctm, fz_rotate(currentRotate));
bbox = fz_round_rect(fz_transform_rect(ctm,currentMediabox));
@@ -188,8 +188,9 @@ Java_com_artifex_mupdf_MuPDFCore_drawPage(JNIEnv *env, jobject thiz, jobject bit
xscale = (float)pageW/(float)(bbox.x1-bbox.x0);
yscale = (float)pageH/(float)(bbox.y1-bbox.y0);
ctm = fz_concat(ctm, fz_scale(xscale, yscale));
+ bbox = fz_round_rect(fz_transform_rect(ctm,currentMediabox));
dev = fz_new_draw_device(glyphcache, pix);
- fz_execute_display_list(currentPageList, dev, ctm, fz_infinite_bbox);
+ fz_execute_display_list(currentPageList, dev, ctm, bbox);
fz_free_device(dev);
fz_drop_pixmap(pix);
LOGE("Rendered");