summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-04-12 16:23:01 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-12 16:23:01 +0000
commita105fa126cfc2de661dca824bd307aa329e22c9d (patch)
tree31ca3f7c7a8b8b0e52fda7219a385d5a293633ec /fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
parentc4242b24262d082f3ad70805aca779a3ff540c2c (diff)
downloadpdfium-a105fa126cfc2de661dca824bd307aa329e22c9d.tar.xz
Change some CPDFXFA_Page methods to take rects and points.
Instead of many int in-parameters. Change-Id: I58b493ac0155f6b45f52963c0f61159633d88e28 Reviewed-on: https://pdfium-review.googlesource.com/30056 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_page.cpp')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_page.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
index a43707a9cf..c3d5e18707 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
@@ -126,32 +126,21 @@ float CPDFXFA_Page::GetPageHeight() const {
return 0.0f;
}
-void CPDFXFA_Page::DeviceToPage(int start_x,
- int start_y,
- int size_x,
- int size_y,
+void CPDFXFA_Page::DeviceToPage(const FX_RECT& rect,
int rotate,
- int device_x,
- int device_y,
+ const CFX_PointF& device_point,
double* page_x,
double* page_y) {
if (!m_pPDFPage && !m_pXFAPageView)
return;
- const FX_RECT rect(start_x, start_y, start_x + size_x, start_y + size_y);
- CFX_PointF pos = GetDisplayMatrix(rect, rotate)
- .GetInverse()
- .Transform(CFX_PointF(static_cast<float>(device_x),
- static_cast<float>(device_y)));
-
+ CFX_PointF pos =
+ GetDisplayMatrix(rect, rotate).GetInverse().Transform(device_point);
*page_x = pos.x;
*page_y = pos.y;
}
-void CPDFXFA_Page::PageToDevice(int start_x,
- int start_y,
- int size_x,
- int size_y,
+void CPDFXFA_Page::PageToDevice(const FX_RECT& rect,
int rotate,
double page_x,
double page_y,
@@ -160,12 +149,9 @@ void CPDFXFA_Page::PageToDevice(int start_x,
if (!m_pPDFPage && !m_pXFAPageView)
return;
- const FX_RECT rect(start_x, start_y, start_x + size_x, start_y + size_y);
CFX_Matrix page2device = GetDisplayMatrix(rect, rotate);
-
CFX_PointF pos = page2device.Transform(
CFX_PointF(static_cast<float>(page_x), static_cast<float>(page_y)));
-
*device_x = FXSYS_round(pos.x);
*device_y = FXSYS_round(pos.y);
}