From 7d75650672a848428aaadb603b2814d33dfb479f Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 15 Mar 2018 19:27:17 +0000 Subject: Add a CFX_PathData::AppendRect() variant. One that takes a CFX_FloatRect instead of LBRT floats. Use it where appropriate. Change-Id: I8ba19e86c61c91d8b4ef685b5cb65c8fb717f013 Reviewed-on: https://pdfium-review.googlesource.com/28581 Reviewed-by: Henrique Nakashima Commit-Queue: Lei Zhang --- core/fpdfdoc/cpdf_annot.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/fpdfdoc/cpdf_annot.cpp') diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp index c74965c3e7..cc70a3087c 100644 --- a/core/fpdfdoc/cpdf_annot.cpp +++ b/core/fpdfdoc/cpdf_annot.cpp @@ -485,11 +485,12 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, graph_state.m_DashArray[0] = graph_state.m_DashArray[1] = 3 * 1.0f; } } + CFX_FloatRect rect = GetRect(); + rect.Deflate(width / 2, width / 2); CFX_PathData path; - width /= 2; - path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, - rect.top - width); + path.AppendRect(rect); + int fill_type = 0; if (pOptions && (pOptions->HasFlag(RENDER_NOPATHSMOOTH))) fill_type |= FXFILL_NOPATHSMOOTH; -- cgit v1.2.3