summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfview.cpp')
-rw-r--r--fpdfsdk/fpdfview.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 57d5d4d343..e1fba8df66 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -855,12 +855,11 @@ DLLEXPORT void STDCALL FPDF_DeviceToPage(FPDF_PAGE page,
CFX_Matrix device2page;
device2page.SetReverse(page2device);
- FX_FLOAT page_x_f = static_cast<FX_FLOAT>(device_x);
- FX_FLOAT page_y_f = static_cast<FX_FLOAT>(device_y);
- device2page.TransformPoint(page_x_f, page_y_f);
+ CFX_PointF pos = device2page.Transform(CFX_PointF(
+ static_cast<FX_FLOAT>(device_x), static_cast<FX_FLOAT>(device_y)));
- *page_x = page_x_f;
- *page_y = page_y_f;
+ *page_x = pos.x;
+ *page_y = pos.y;
#endif // PDF_ENABLE_XFA
}
@@ -885,12 +884,11 @@ DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page,
#else // PDF_ENABLE_XFA
CFX_Matrix page2device =
pPage->GetDisplayMatrix(start_x, start_y, size_x, size_y, rotate);
- FX_FLOAT device_x_f = static_cast<FX_FLOAT>(page_x);
- FX_FLOAT device_y_f = static_cast<FX_FLOAT>(page_y);
- page2device.TransformPoint(device_x_f, device_y_f);
+ CFX_PointF pos = page2device.Transform(
+ CFX_PointF(static_cast<FX_FLOAT>(page_x), static_cast<FX_FLOAT>(page_y)));
- *device_x = FXSYS_round(device_x_f);
- *device_y = FXSYS_round(device_y_f);
+ *device_x = FXSYS_round(pos.x);
+ *device_y = FXSYS_round(pos.y);
#endif // PDF_ENABLE_XFA
}