From b3a5240832fce3f0b706c16070a1e69c2c1edb86 Mon Sep 17 00:00:00 2001 From: Ralf Sippl Date: Mon, 19 Mar 2018 23:30:28 +0000 Subject: 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 (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 Commit-Queue: Lei Zhang --- fpdfsdk/fpdfannot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fpdfsdk/fpdfannot.cpp') diff --git a/fpdfsdk/fpdfannot.cpp b/fpdfsdk/fpdfannot.cpp index 29a6751bff..84c6c03194 100644 --- a/fpdfsdk/fpdfannot.cpp +++ b/fpdfsdk/fpdfannot.cpp @@ -614,7 +614,7 @@ FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(pAnnotDict, CPDF_Annot::AppearanceMode::Normal); if (pStream) { - CFX_FloatRect newRect = CPDF_Annot::RectFromQuadPoints(pAnnotDict); + CFX_FloatRect newRect = CPDF_Annot::BoundingRectFromQuadPoints(pAnnotDict); if (newRect.Contains(pStream->GetDict()->GetRectFor("BBox"))) pStream->GetDict()->SetRectFor("BBox", newRect); } -- cgit v1.2.3