diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-02-09 13:07:43 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-09 19:02:55 +0000 |
commit | afb44560a21298b3588b36cbaf45e2be50f2e75b (patch) | |
tree | 21f3ececad017e6be64a19c4370cfe9fd7f9c29c /fpdfsdk/fpdfxfa | |
parent | 67e4faaf8be0aebc67ebfb96d33933d9f9119d20 (diff) | |
download | pdfium-afb44560a21298b3588b36cbaf45e2be50f2e75b.tar.xz |
Remove Transform in favour of TransformPoint
This CL removes the two Transform() overrides from CFX_Matrix and calls the
TransformPoint methods directly. In the case of the 4 param version the
values were assigned to the out values before calling.
Change-Id: Id633826caec75b848774dcda6cfdcef2dbf5a7db
Reviewed-on: https://pdfium-review.googlesource.com/2573
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfxfa')
-rw-r--r-- | fpdfsdk/fpdfxfa/cpdfxfa_page.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp index f39a01078e..b708a361e5 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp @@ -154,13 +154,13 @@ void CPDFXFA_Page::DeviceToPage(int start_x, if (!m_pPDFPage && !m_pXFAPageView) return; - FX_FLOAT page_x_f, page_y_f; - CFX_Matrix device2page; device2page.SetReverse( GetDisplayMatrix(start_x, start_y, size_x, size_y, rotate)); - device2page.Transform(static_cast<FX_FLOAT>(device_x), - static_cast<FX_FLOAT>(device_y), page_x_f, page_y_f); + + 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); *page_x = page_x_f; *page_y = page_y_f; @@ -178,13 +178,12 @@ void CPDFXFA_Page::PageToDevice(int start_x, if (!m_pPDFPage && !m_pXFAPageView) return; - FX_FLOAT device_x_f; - FX_FLOAT device_y_f; - CFX_Matrix page2device = GetDisplayMatrix(start_x, start_y, size_x, size_y, rotate); - page2device.Transform(static_cast<FX_FLOAT>(page_x), - static_cast<FX_FLOAT>(page_y), device_x_f, device_y_f); + + 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); *device_x = FXSYS_round(device_x_f); *device_y = FXSYS_round(device_y_f); |