summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-11-02 12:19:10 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-11-02 12:24:17 +0100
commit076780b0830dad0dad36915f7fc0a3fef272e59f (patch)
tree70fe9cf5d641b511cf689eaf153810487240528e /platform
parent7eb87f9493a5fd5e9e48183d8e47a201dc3ef401 (diff)
downloadmupdf-076780b0830dad0dad36915f7fc0a3fef272e59f.tar.xz
android: Fix screen updates when deleting annotations.
Diffstat (limited to 'platform')
-rw-r--r--platform/android/viewer/Makefile4
-rw-r--r--platform/android/viewer/jni/mupdf.c23
2 files changed, 27 insertions, 0 deletions
diff --git a/platform/android/viewer/Makefile b/platform/android/viewer/Makefile
index 9d061919..cc557b85 100644
--- a/platform/android/viewer/Makefile
+++ b/platform/android/viewer/Makefile
@@ -1,3 +1,7 @@
default:
ndk-build
ant debug
+
+install:
+ ndk-build
+ ant debug install
diff --git a/platform/android/viewer/jni/mupdf.c b/platform/android/viewer/jni/mupdf.c
index e7ef8f38..c8c01866 100644
--- a/platform/android/viewer/jni/mupdf.c
+++ b/platform/android/viewer/jni/mupdf.c
@@ -689,10 +689,32 @@ static void update_changed_rects(globals *glo, page_cache *pc, pdf_document *ido
fz_bound_annot(ctx, annot, &node->rect);
node->next = pc->hq_changed_rects;
pc->hq_changed_rects = node;
+
+ pannot->changed = 0;
}
}
}
+static void update_changed_rects_all_page(globals *glo, page_cache *pc, pdf_document *idoc)
+{
+ fz_context *ctx = glo->ctx;
+ fz_page *page = pc->page;
+ rect_node *node;
+
+ drop_changed_rects(ctx, &pc->hq_changed_rects);
+ drop_changed_rects(ctx, &pc->changed_rects);
+
+ node = fz_malloc_struct(ctx, rect_node);
+ fz_bound_page(ctx, page, &node->rect);
+ node->next = pc->changed_rects;
+ pc->changed_rects = node;
+
+ node = fz_malloc_struct(ctx, rect_node);
+ fz_bound_page(ctx, page, &node->rect);
+ node->next = pc->hq_changed_rects;
+ pc->hq_changed_rects = node;
+}
+
JNIEXPORT jboolean JNICALL
JNI_FN(MuPDFCore_drawPage)(JNIEnv *env, jobject thiz, jobject bitmap,
int pageW, int pageH, int patchX, int patchY, int patchW, int patchH, jlong cookiePtr)
@@ -1749,6 +1771,7 @@ JNI_FN(MuPDFCore_deleteAnnotationInternal)(JNIEnv * env, jobject thiz, int annot
if (annot)
{
pdf_delete_annot(ctx, (pdf_page *)pc->page, (pdf_annot *)annot);
+ update_changed_rects_all_page(glo, pc, idoc);
dump_annotation_display_lists(glo);
}
}