diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-02-21 12:56:24 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-21 19:05:18 +0000 |
commit | 1f403cee9478021862c7cc4e516907bd51e8f0f6 (patch) | |
tree | 57829fa3b036ee9ddd57a8ad5b3541fe4e96fdb8 /xfa/fwl/cfwl_widgetmgr.cpp | |
parent | 04557b8a7c2d3dab06fe9eadacc3c7744b3e14e2 (diff) | |
download | pdfium-1f403cee9478021862c7cc4e516907bd51e8f0f6.tar.xz |
Convert more TransformPoint calls to Transform
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 <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_widgetmgr.cpp')
-rw-r--r-- | xfa/fwl/cfwl_widgetmgr.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp index 0af93dc38b..ea4cbde230 100644 --- a/xfa/fwl/cfwl_widgetmgr.cpp +++ b/xfa/fwl/cfwl_widgetmgr.cpp @@ -160,7 +160,10 @@ void CFWL_WidgetMgr::RepaintWidget(CFWL_Widget* pWidget, if (!pNative) return; - pWidget->TransformTo(pNative, transformedRect.left, transformedRect.top); + CFX_PointF pos = pWidget->TransformTo( + pNative, CFX_PointF(transformedRect.left, transformedRect.top)); + transformedRect.left = pos.x; + transformedRect.top = pos.y; } AddRedrawCounts(pNative); m_pAdapter->RepaintWidget(pNative); @@ -260,24 +263,21 @@ CFWL_Widget* CFWL_WidgetMgr::GetWidgetAtPoint(CFWL_Widget* parent, if (!parent) return nullptr; - FX_FLOAT x1; - FX_FLOAT y1; + CFX_PointF pos; CFWL_Widget* child = GetLastChildWidget(parent); while (child) { if ((child->GetStates() & FWL_WGTSTATE_Invisible) == 0) { - x1 = x; - y1 = y; CFX_Matrix m; m.SetIdentity(); CFX_Matrix matrixOnParent; m.SetReverse(matrixOnParent); - m.TransformPoint(x1, y1); + pos = m.Transform(CFX_PointF(x, y)); + CFX_RectF bounds = child->GetWidgetRect(); - if (bounds.Contains(x1, y1)) { - x1 -= bounds.left; - y1 -= bounds.top; - return GetWidgetAtPoint(child, x1, y1); + if (bounds.Contains(pos.x, pos.y)) { + pos -= bounds.TopLeft(); + return GetWidgetAtPoint(child, pos.x, pos.y); } } child = GetPriorSiblingWidget(child); @@ -484,7 +484,9 @@ void CFWL_WidgetMgr::DrawChild(CFWL_Widget* parent, widgetMatrix.Concat(*pMatrix); if (!bFormDisable) { - widgetMatrix.TransformPoint(clipBounds.left, clipBounds.top); + CFX_PointF pos = widgetMatrix.Transform(clipBounds.TopLeft()); + clipBounds.left = pos.x; + clipBounds.top = pos.y; clipBounds.Intersect(rtClip); if (clipBounds.IsEmpty()) continue; |