From e792804dcfa3c8d868d58a28c421feb17dfc0b7e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 2 Jul 2018 12:07:04 +0200 Subject: gl: Poll changed annots with pdf_update_page, and clear after rendering. --- platform/gl/gl-main.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'platform/gl/gl-main.c') diff --git a/platform/gl/gl-main.c b/platform/gl/gl-main.c index ee182cdd..899dc4ec 100644 --- a/platform/gl/gl-main.c +++ b/platform/gl/gl-main.c @@ -266,6 +266,13 @@ void render_page(void) fz_gamma_pixmap(ctx, pix, 1 / 1.4f); } + if (pdf) + { + pdf_annot *annot; + for (annot = page->annots; annot; annot = annot->next) + annot->has_new_ap = 0; + } + ui_texture_from_pixmap(&page_tex, pix); fz_drop_pixmap(ctx, pix); } @@ -573,8 +580,8 @@ static void do_forms(void) { if (pdf->focus) ui.active = &do_forms_tag; - pdf_update_page(ctx, (pdf_page*)page); - render_page(); + if (pdf_update_page(ctx, page)) + render_page(); } } else if (ui.active == &do_forms_tag && !ui.down) @@ -585,8 +592,8 @@ static void do_forms(void) event.event.pointer.ptype = PDF_POINTER_UP; if (pdf_pass_event(ctx, pdf, (pdf_page*)page, &event)) { - pdf_update_page(ctx, (pdf_page*)page); - render_page(); + if (pdf_update_page(ctx, page)) + render_page(); } } } -- cgit v1.2.3