diff options
author | Ralf Sippl <ralf.sippl@gmail.com> | 2018-03-19 23:30:28 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-03-19 23:30:28 +0000 |
commit | b3a5240832fce3f0b706c16070a1e69c2c1edb86 (patch) | |
tree | 36d6f6ab3853a5c241b3b437a1dc181be5329f27 /core/fpdfdoc/cpdf_annot.h | |
parent | 3448143cc2aa517958b6551b9419e1e6141fb5cd (diff) | |
download | pdfium-b3a5240832fce3f0b706c16070a1e69c2c1edb86.tar.xz |
Calculate AP for multi-line markup annotations correctly
Currently, when constructing AP for multi-line markup annotations, we
only take into account the first set of quadpoints, resulting in only
the first line of the annotation being displayed if the annotation spans
multiple lines.
This CL, initially written by Jane Liu <janeliulwq@google.com>
(https://pdfium-review.googlesource.com/12010) takes into account all
the quadpoints, so multi-line annotations can be displayed correctly.
BUG=pdfium:876
Change-Id: I8be10ee38e01eb6525ddef556df1b727189455c7
Reviewed-on: https://pdfium-review.googlesource.com/28590
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_annot.h')
-rw-r--r-- | core/fpdfdoc/cpdf_annot.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/fpdfdoc/cpdf_annot.h b/core/fpdfdoc/cpdf_annot.h index 499c62dcba..3f1164ad18 100644 --- a/core/fpdfdoc/cpdf_annot.h +++ b/core/fpdfdoc/cpdf_annot.h @@ -16,6 +16,7 @@ #include "core/fxcrt/maybe_owned.h" class CFX_RenderDevice; +class CPDF_Array; class CPDF_Dictionary; class CPDF_Document; class CPDF_Form; @@ -66,7 +67,12 @@ class CPDF_Annot { static bool IsAnnotationHidden(CPDF_Dictionary* pAnnotDict); static CPDF_Annot::Subtype StringToAnnotSubtype(const ByteString& sSubtype); static ByteString AnnotSubtypeToString(CPDF_Annot::Subtype nSubtype); - static CFX_FloatRect RectFromQuadPoints(CPDF_Dictionary* pAnnotDict); + static CFX_FloatRect RectFromQuadPointsArray(const CPDF_Array* pArray, + size_t nIndex); + static CFX_FloatRect BoundingRectFromQuadPoints(CPDF_Dictionary* pAnnotDict); + static CFX_FloatRect RectFromQuadPoints(CPDF_Dictionary* pAnnotDict, + size_t nIndex); + static size_t QuadPointCount(const CPDF_Array* pArray); // The second constructor does not take ownership of the dictionary. CPDF_Annot(std::unique_ptr<CPDF_Dictionary> pDict, CPDF_Document* pDocument); |