summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-11-22 13:36:43 -0800
committerLei Zhang <thestig@chromium.org>2016-11-22 13:36:43 -0800
commitdad0707d0e7ea3f612dd14a5e35b5af163cedf82 (patch)
treed5836893edb3ba80163e2a92b09dafb725918e88
parent9439f839d1a17f251a6b78b5cbf97c5848d5d52b (diff)
downloadpdfium-dad0707d0e7ea3f612dd14a5e35b5af163cedf82.tar.xz
M55: Invalidate a slightly larger rect when updating popup annotations.
It looks like sometimes there are rounding errors in the display pipeline when displaying / hiding popup annotations. Compensate by rouding up the damaged rect slightly. BUG=chromium:662804 Review-Url: https://codereview.chromium.org/2492733002 (cherry picked from commit c75dcd253d75ea93608410d90a3ce1b605590af0) Review URL: https://codereview.chromium.org/2523023002 .
-rw-r--r--fpdfsdk/cpdfsdk_baannothandler.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/fpdfsdk/cpdfsdk_baannothandler.cpp b/fpdfsdk/cpdfsdk_baannothandler.cpp
index a9e24fb71a..7ed42a7d98 100644
--- a/fpdfsdk/cpdfsdk_baannothandler.cpp
+++ b/fpdfsdk/cpdfsdk_baannothandler.cpp
@@ -28,6 +28,11 @@ void UpdateAnnotRects(CPDFSDK_PageView* pPageView, CPDFSDK_BAAnnot* pBAAnnot) {
rects.push_back(pBAAnnot->GetRect());
if (CPDF_Annot* pPopupAnnot = pBAAnnot->GetPDFPopupAnnot())
rects.push_back(pPopupAnnot->GetRect());
+
+ // Make the rects round up to avoid https://crbug.com/662804
+ for (CFX_FloatRect& rect : rects)
+ rect.Inflate(1, 1);
+
pPageView->UpdateRects(rects);
}