summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_baannothandler.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-11-14 13:15:47 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-14 13:15:47 -0800
commitc75dcd253d75ea93608410d90a3ce1b605590af0 (patch)
treee47cfee1372e505a6b00bbfab7e389371a87627c /fpdfsdk/cpdfsdk_baannothandler.cpp
parentbe83b31dc4f21e7be066ac1093fcd9b6aab058ed (diff)
downloadpdfium-c75dcd253d75ea93608410d90a3ce1b605590af0.tar.xz
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
Diffstat (limited to 'fpdfsdk/cpdfsdk_baannothandler.cpp')
-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 5cabef994a..617d88fd41 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);
}