From 1f403cee9478021862c7cc4e516907bd51e8f0f6 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 21 Feb 2017 12:56:24 -0500 Subject: Convert more TransformPoint calls to Transform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This Cl converts several uses of TransformPoint to use Transform(CFX_PointF). Change-Id: I9bc3c484e0a4304b904584218bd9e59dec7db727 Reviewed-on: https://pdfium-review.googlesource.com/2791 Commit-Queue: dsinclair Reviewed-by: Tom Sepez Reviewed-by: Nicolás Peña --- core/fxge/ge/cfx_pathdata.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'core/fxge/ge/cfx_pathdata.cpp') diff --git a/core/fxge/ge/cfx_pathdata.cpp b/core/fxge/ge/cfx_pathdata.cpp index 11c421e468..e06eadd6ce 100644 --- a/core/fxge/ge/cfx_pathdata.cpp +++ b/core/fxge/ge/cfx_pathdata.cpp @@ -452,26 +452,24 @@ bool CFX_PathData::IsRect(const CFX_Matrix* pMatrix, return false; } - FX_FLOAT x[5]; - FX_FLOAT y[5]; + CFX_PointF points[5]; for (size_t i = 0; i < m_Points.size(); i++) { - x[i] = m_Points[i].m_PointX; - y[i] = m_Points[i].m_PointY; - pMatrix->TransformPoint(x[i], y[i]); + points[i] = pMatrix->Transform( + CFX_PointF(m_Points[i].m_PointX, m_Points[i].m_PointY)); if (i == 0) continue; if (m_Points[i].m_Type != FXPT_TYPE::LineTo) return false; - if (x[i] != x[i - 1] && y[i] != y[i - 1]) + if (points[i].x != points[i - 1].x && points[i].y != points[i - 1].y) return false; } if (pRect) { - pRect->left = x[0]; - pRect->right = x[2]; - pRect->bottom = y[0]; - pRect->top = y[2]; + pRect->left = points[0].x; + pRect->right = points[2].x; + pRect->bottom = points[0].y; + pRect->top = points[2].y; pRect->Normalize(); } return true; -- cgit v1.2.3