From 28e88083d782eba796ec9af2469e57011dc4aa89 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 5 Jul 2011 16:52:31 +0100 Subject: 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. --- android/jni/mupdf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'android/jni') 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"); -- cgit v1.2.3