diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-02-21 14:27:59 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-21 20:44:29 +0000 |
commit | b45ea1fce52d93615470bab8b671cba5907fb01e (patch) | |
tree | 15153c437a253f73b3f5bb154a294ace77fe2c6d /xfa/fwl/cfwl_listbox.cpp | |
parent | 37a35df8c878d6e21a62ce0dfd2d480997d9e86c (diff) | |
download | pdfium-b45ea1fce52d93615470bab8b671cba5907fb01e.tar.xz |
Convert CFWL messages to use CFX_PointF
This Cl updates the various CFWL_Message classes to take CFX_PointF instead of
x,y values.
Change-Id: I5d9d01d68be64fc9e69c04574994c01286ad24e1
Reviewed-on: https://pdfium-review.googlesource.com/2811
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_listbox.cpp')
-rw-r--r-- | xfa/fwl/cfwl_listbox.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/xfa/fwl/cfwl_listbox.cpp b/xfa/fwl/cfwl_listbox.cpp index aed2a9a733..0b82709972 100644 --- a/xfa/fwl/cfwl_listbox.cpp +++ b/xfa/fwl/cfwl_listbox.cpp @@ -75,18 +75,18 @@ void CFWL_ListBox::Update() { CalcSize(false); } -FWL_WidgetHit CFWL_ListBox::HitTest(FX_FLOAT fx, FX_FLOAT fy) { +FWL_WidgetHit CFWL_ListBox::HitTest(const CFX_PointF& point) { if (IsShowScrollBar(false)) { CFX_RectF rect = m_pHorzScrollBar->GetWidgetRect(); - if (rect.Contains(fx, fy)) + if (rect.Contains(point)) return FWL_WidgetHit::HScrollBar; } if (IsShowScrollBar(true)) { CFX_RectF rect = m_pVertScrollBar->GetWidgetRect(); - if (rect.Contains(fx, fy)) + if (rect.Contains(point)) return FWL_WidgetHit::VScrollBar; } - if (m_rtClient.Contains(fx, fy)) + if (m_rtClient.Contains(point)) return FWL_WidgetHit::Client; return FWL_WidgetHit::Unknown; } @@ -304,8 +304,8 @@ void CFWL_ListBox::SetFocusItem(CFWL_ListItem* pItem) { } } -CFWL_ListItem* CFWL_ListBox::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) { - fx -= m_rtConent.left, fy -= m_rtConent.top; +CFWL_ListItem* CFWL_ListBox::GetItemAtPoint(const CFX_PointF& point) { + CFX_PointF pos = point - m_rtConent.TopLeft(); FX_FLOAT fPosX = 0.0f; if (m_pHorzScrollBar) fPosX = m_pHorzScrollBar->GetPos(); @@ -322,7 +322,7 @@ CFWL_ListItem* CFWL_ListBox::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) { CFX_RectF rtItem = pItem->GetRect(); rtItem.Offset(-fPosX, -fPosY); - if (rtItem.Contains(fx, fy)) + if (rtItem.Contains(pos)) return pItem; } return nullptr; @@ -748,7 +748,7 @@ void CFWL_ListBox::OnLButtonDown(CFWL_MessageMouse* pMsg) { if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) SetFocus(true); - CFWL_ListItem* pItem = GetItemAtPoint(pMsg->m_fx, pMsg->m_fy); + CFWL_ListItem* pItem = GetItemAtPoint(pMsg->m_pos); if (!pItem) return; |