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_notedriver.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_notedriver.cpp')
-rw-r--r-- | xfa/fwl/cfwl_notedriver.cpp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/xfa/fwl/cfwl_notedriver.cpp b/xfa/fwl/cfwl_notedriver.cpp index f4db9b14ab..6904759e59 100644 --- a/xfa/fwl/cfwl_notedriver.cpp +++ b/xfa/fwl/cfwl_notedriver.cpp @@ -341,8 +341,12 @@ bool CFWL_NoteDriver::DoMouse(CFWL_Message* pMessage, pMsg->m_dwCmd == FWL_MouseCommand::Enter) { return !!pMsg->m_pDstTarget; } - if (pMsg->m_pDstTarget != pMessageForm) - pMsg->m_pDstTarget->TransformTo(pMessageForm, pMsg->m_fx, pMsg->m_fy); + if (pMsg->m_pDstTarget != pMessageForm) { + CFX_PointF point = pMsg->m_pDstTarget->TransformTo( + pMessageForm, CFX_PointF(pMsg->m_fx, pMsg->m_fy)); + pMsg->m_fx = point.x; + pMsg->m_fy = point.y; + } if (!DoMouseEx(pMsg, pMessageForm)) pMsg->m_pDstTarget = pMessageForm; return true; @@ -360,7 +364,10 @@ bool CFWL_NoteDriver::DoWheel(CFWL_Message* pMessage, if (!pDst) return false; - pMessageForm->TransformTo(pDst, pMsg->m_fx, pMsg->m_fy); + CFX_PointF point = + pMessageForm->TransformTo(pDst, CFX_PointF(pMsg->m_fx, pMsg->m_fy)); + pMsg->m_fx = point.x; + pMsg->m_fy = point.y; pMsg->m_pDstTarget = pDst; return true; } @@ -380,8 +387,12 @@ bool CFWL_NoteDriver::DoMouseEx(CFWL_Message* pMessage, pWidgetMgr->GetWidgetAtPoint(pMessageForm, pMsg->m_fx, pMsg->m_fy); } if (pTarget) { - if (pMessageForm != pTarget) - pMessageForm->TransformTo(pTarget, pMsg->m_fx, pMsg->m_fy); + if (pMessageForm != pTarget) { + CFX_PointF point = pMessageForm->TransformTo( + pTarget, CFX_PointF(pMsg->m_fx, pMsg->m_fy)); + pMsg->m_fx = point.x; + pMsg->m_fy = point.y; + } } if (!pTarget) return false; @@ -398,10 +409,10 @@ void CFWL_NoteDriver::MouseSecondary(CFWL_Message* pMessage) { CFWL_MessageMouse* pMsg = static_cast<CFWL_MessageMouse*>(pMessage); if (m_pHover) { CFWL_MessageMouse msLeave(nullptr, m_pHover); - msLeave.m_fx = pMsg->m_fx; - msLeave.m_fy = pMsg->m_fy; - pTarget->TransformTo(m_pHover, msLeave.m_fx, msLeave.m_fy); - + CFX_PointF point = + pTarget->TransformTo(m_pHover, CFX_PointF(pMsg->m_fx, pMsg->m_fy)); + msLeave.m_fx = point.x; + msLeave.m_fy = point.y; msLeave.m_dwFlags = 0; msLeave.m_dwCmd = FWL_MouseCommand::Leave; DispatchMessage(&msLeave, nullptr); |