From a8db06a715cd0090a8c838a7b2861ca3c657f6a2 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 12 Apr 2018 17:53:15 +0000 Subject: Change CPDF{XFA}_Page::PageToDevice() to take a CFX_PointF. Instead of taking two doubles. The doubles get casted to floats anyway. Change-Id: Ie16dc60fa5d6412026a5fda08c8c64d4fa2d56c4 Reviewed-on: https://pdfium-review.googlesource.com/30410 Reviewed-by: dsinclair Commit-Queue: dsinclair --- fpdfsdk/fpdfxfa/cpdfxfa_page.cpp | 11 +++++------ fpdfsdk/fpdfxfa/cpdfxfa_page.h | 3 +-- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'fpdfsdk/fpdfxfa') diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp index 8fea85d72b..8268ed8759 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp @@ -138,16 +138,15 @@ Optional CPDFXFA_Page::DeviceToPage( return pos; } -Optional CPDFXFA_Page::PageToDevice(const FX_RECT& rect, - int rotate, - double page_x, - double page_y) const { +Optional CPDFXFA_Page::PageToDevice( + const FX_RECT& rect, + int rotate, + const CFX_PointF& page_point) const { if (!m_pPDFPage && !m_pXFAPageView) return {}; CFX_Matrix page2device = GetDisplayMatrix(rect, rotate); - return page2device.Transform( - CFX_PointF(static_cast(page_x), static_cast(page_y))); + return page2device.Transform(page_point); } CFX_Matrix CPDFXFA_Page::GetDisplayMatrix(const FX_RECT& rect, diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.h b/fpdfsdk/fpdfxfa/cpdfxfa_page.h index 131e811b66..0a5e3fcc14 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_page.h +++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.h @@ -44,8 +44,7 @@ class CPDFXFA_Page : public Retainable { const CFX_PointF& device_point) const; Optional PageToDevice(const FX_RECT& rect, int rotate, - double page_x, - double page_y) const; + const CFX_PointF& page_point) const; CFX_Matrix GetDisplayMatrix(const FX_RECT& rect, int iRotate) const; -- cgit v1.2.3