[evince] backend: fix swapped y-coordinates when adding annotations



commit a4cc84f93465b6459893a757d37ea11c2c08b666
Author: Casey Jao <casey jao gmail com>
Date:   Sat Apr 20 04:58:38 2019 +0000

    backend: fix swapped y-coordinates when adding annotations
    
    On commit 838fde1acf8e, pdf_document_annotations_add_annotation
    was meant to mimic the behaviour of
    pdf_document_annotations_save_annotation to updte the annotation
    area based on its bounding box. However, it missed correcting the
    coordinates, which this patch fixes.
    
    Fix #1008

 backend/pdf/ev-poppler.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc
index 2b8c9a67..96111aed 100644
--- a/backend/pdf/ev-poppler.cc
+++ b/backend/pdf/ev-poppler.cc
@@ -3606,8 +3606,10 @@ pdf_document_annotations_add_annotation (EvDocumentAnnotations *document_annotat
                        if (bbox.x1 != 0 && bbox.y1 != 0 && bbox.x2 != 0 && bbox.y2 != 0) {
                                poppler_rect.x1 = rect.x1 = bbox.x1;
                                poppler_rect.x2 = rect.x2 = bbox.x2;
-                               poppler_rect.y1 = rect.y1 = height - bbox.y2;
-                               poppler_rect.y2 = rect.y2 = height - bbox.y1;
+                               rect.y1 = height - bbox.y2;
+                               rect.y2 = height - bbox.y1;
+                               poppler_rect.y1 = bbox.y1;
+                               poppler_rect.y2 = bbox.y2;
 
                                ev_annotation_set_area (annot, &rect);
                        }


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