From 0a17fafd723e8684d1deb4b5ceea58967a0154da Mon Sep 17 00:00:00 2001 From: tonikitoo Date: Thu, 15 Sep 2016 13:50:50 -0700 Subject: Use either /RECT or /QuadPoints for annotation coordinates, depending on /AP On Acrobat, if "/AP" is present on a text markup definition, the coordinates used to draw the annotation come from "/Rect values, whereas if "/AP" is not defined, the array defined in /QuadPoints is used to grab the annotation coordinates from. PDFium, on the other hand, uses "/Rect" regardless of presence or absence of "/AP". CL fixes PDFium to work similarly to Acrobat, in this case. TEST=testing/resources/pixel/bug_585_*.in BUG=pdfium:585 Review-Url: https://codereview.chromium.org/2289293005 --- core/fpdfdoc/include/cpdf_annot.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/fpdfdoc/include') diff --git a/core/fpdfdoc/include/cpdf_annot.h b/core/fpdfdoc/include/cpdf_annot.h index c16decc7d6..43f58931d3 100644 --- a/core/fpdfdoc/include/cpdf_annot.h +++ b/core/fpdfdoc/include/cpdf_annot.h @@ -71,6 +71,7 @@ class CPDF_Annot { static CPDF_Annot::Subtype StringToAnnotSubtype( const CFX_ByteString& sSubtype); static CFX_ByteString AnnotSubtypeToString(CPDF_Annot::Subtype nSubtype); + static CFX_FloatRect RectFromQuadPoints(CPDF_Dictionary* pAnnotDict); CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument, bool bToOwnDict); ~CPDF_Annot(); @@ -102,6 +103,8 @@ class CPDF_Annot { void GenerateAPIfNeeded(); bool ShouldDrawAnnotation(); + CFX_FloatRect RectForDrawing() const; + // For regular annotations, |m_pAnnotDict| is not owned. For // our artificially created popup annotations, |m_pAnnotDict| // is owned by this class. @@ -112,6 +115,8 @@ class CPDF_Annot { std::map> m_APMap; // |m_bOpenState| is only set for popup annotations. bool m_bOpenState; + bool m_bHasGeneratedAP; + bool m_bIsTextMarkupAnnotation; // Not owned. If there is a valid pointer in |m_pPopupAnnot|, // then this annot is never a popup. CPDF_Annot* m_pPopupAnnot; -- cgit v1.2.3