emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/pdf-tools a4905d8352: Revert "Adds translattion of highlig


From: ELPA Syncer
Subject: [nongnu] elpa/pdf-tools a4905d8352: Revert "Adds translattion of highlight annotations"
Date: Tue, 4 Oct 2022 02:59:02 -0400 (EDT)

branch: elpa/pdf-tools
commit a4905d8352437905e6ba1d923cd24ad260c92030
Author: Vedang Manerikar <ved.manerikar@gmail.com>
Commit: Vedang Manerikar <ved.manerikar@gmail.com>

    Revert "Adds translattion of highlight annotations"
    
    This reverts commit 0107f80dcf268d08ac075b01729820062c0fbd67
    
    The reason for doing this is explained by @vizs in #143, copying the
    message here:
    
    Andreas wrote the function
    `annotation_translate_quadrilateral`[^1][^2] to fix misplaced
    annotations due to the then bug in `glib`. This misplacement bug can
    be seen in the images posted in issue politza/pdf-tools#577, along
    with PDFs in which the bug can be reproduced.
    
    This lack of translation in the `glib` backend was fixed in `poppler
    0.86.0` but the workaround was still left hanging in `epdfinfo.c`
    which brings us to today where this unneeded translation bites our
    back. I commented out the calls to
    `annotation_translate_quadrilateral` in `epdinfo.c` and to my
    surprise, there were no misplaced translations in files which
    displayed the misplacing behaviour and in files which did not have
    this behaviour.
    
    [1]:
    
https://github.com/politza/pdf-tools/commit/0107f80dcf268d08ac075b01729820062c0fbd67
    [2]: politza/pdf-tools#122
    
    Closes: #143
    Closes: #146
---
 server/epdfinfo.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/server/epdfinfo.c b/server/epdfinfo.c
index 770035d644..5dabe7ee47 100644
--- a/server/epdfinfo.c
+++ b/server/epdfinfo.c
@@ -1309,25 +1309,6 @@ annotation_get_by_key (document_t *doc, const gchar *key)
 }
 
 #ifdef HAVE_POPPLER_ANNOT_MARKUP
-void
-annotation_translate_quadrilateral (PopplerPage *page, PopplerQuadrilateral 
*q, gboolean inverse)
-{
-  PopplerRectangle cbox;
-  gdouble xs, ys;
-
-  poppler_page_get_crop_box (page, &cbox);
-  xs = MIN (cbox.x1, cbox.x2);
-  ys = MIN (cbox.y1, cbox.y2);
-
-  if (inverse)
-    {
-      xs = -xs; ys = -ys;
-    }
-
-  q->p1.x -= xs, q->p2.x -= xs; q->p3.x -= xs; q->p4.x -= xs;
-  q->p1.y -= ys, q->p2.y -= ys; q->p3.y -= ys; q->p4.y -= ys;
-}
-
 static cairo_region_t*
 annotation_markup_get_text_regions (PopplerPage *page, PopplerAnnotTextMarkup 
*a)
 {
@@ -1343,7 +1324,6 @@ annotation_markup_get_text_regions (PopplerPage *page, 
PopplerAnnotTextMarkup *a
       PopplerQuadrilateral *q = &g_array_index (quads, PopplerQuadrilateral, 
i);
       cairo_rectangle_int_t r;
 
-      annotation_translate_quadrilateral (page, q, FALSE);
       q->p1.y = height - q->p1.y;
       q->p2.y = height - q->p2.y;
       q->p3.y = height - q->p3.y;
@@ -1398,7 +1378,6 @@ annotation_markup_append_text_region (PopplerPage *page, 
PopplerRectangle *regio
       q.p3.x = r->x1;
       q.p3.y = height - r->y2;
 
-      annotation_translate_quadrilateral (page, &q, TRUE);
       g_array_append_val (garray, q);
     }
   g_list_free (regions);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]