summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVedang Manerikar <ved.manerikar@gmail.com>2022-10-04 11:32:41 +0530
committerVedang Manerikar <ved.manerikar@gmail.com>2022-10-04 11:32:41 +0530
commita4905d8352437905e6ba1d923cd24ad260c92030 (patch)
tree2d54cf5207ccafc676fd536ad4afe1f6f4205a57
parentaec8ecd0066ba2cbfefed1330a71deada89f5b5a (diff)
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
-rw-r--r--server/epdfinfo.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/server/epdfinfo.c b/server/epdfinfo.c
index 770035d..5dabe7e 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);