From 77f9bff2c229df771a43448a9d5087e042235936 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 29 Aug 2017 11:34:12 -0700 Subject: Reduce rounding errors when Invalidating rects. Instead of using CFX_FloatRect::ToFxRect(), which always rounds down, use GetOuterRect() which correctly rounds up / down depending on the side of the rectangle. Change-Id: I7abd3a65e8c0467ed4303292f26a72737a5d553b Reviewed-on: https://pdfium-review.googlesource.com/12312 Commit-Queue: dsinclair Reviewed-by: dsinclair --- fpdfsdk/cpdfsdk_pageview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/cpdfsdk_pageview.cpp') diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp index c69f0990b1..358f72705d 100644 --- a/fpdfsdk/cpdfsdk_pageview.cpp +++ b/fpdfsdk/cpdfsdk_pageview.cpp @@ -459,12 +459,12 @@ void CPDFSDK_PageView::LoadFXAnnots() { void CPDFSDK_PageView::UpdateRects(const std::vector& rects) { for (const auto& rc : rects) - m_pFormFillEnv->Invalidate(m_page, rc.ToFxRect()); + m_pFormFillEnv->Invalidate(m_page, rc.GetOuterRect()); } void CPDFSDK_PageView::UpdateView(CPDFSDK_Annot* pAnnot) { CFX_FloatRect rcWindow = pAnnot->GetRect(); - m_pFormFillEnv->Invalidate(m_page, rcWindow.ToFxRect()); + m_pFormFillEnv->Invalidate(m_page, rcWindow.GetOuterRect()); } int CPDFSDK_PageView::GetPageIndex() const { -- cgit v1.2.3