summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/include
diff options
context:
space:
mode:
authortonikitoo <tonikitoo@igalia.com>2016-09-15 13:50:50 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-15 13:50:50 -0700
commit0a17fafd723e8684d1deb4b5ceea58967a0154da (patch)
tree6e438c8fab198e4e315243be858feaaff7a1a813 /core/fpdfdoc/include
parent84be3a3cfec5107aac9a58ea00b58b733d393c7d (diff)
downloadpdfium-0a17fafd723e8684d1deb4b5ceea58967a0154da.tar.xz
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
Diffstat (limited to 'core/fpdfdoc/include')
-rw-r--r--core/fpdfdoc/include/cpdf_annot.h5
1 files changed, 5 insertions, 0 deletions
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<CPDF_Stream*, std::unique_ptr<CPDF_Form>> 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;