diff options
Diffstat (limited to 'fpdfsdk/fxedit/fxet_list.cpp')
-rw-r--r-- | fpdfsdk/fxedit/fxet_list.cpp | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/fpdfsdk/fxedit/fxet_list.cpp b/fpdfsdk/fxedit/fxet_list.cpp index 39877c955f..cf718b9acb 100644 --- a/fpdfsdk/fxedit/fxet_list.cpp +++ b/fpdfsdk/fxedit/fxet_list.cpp @@ -207,33 +207,37 @@ void CFX_ListCtrl::SetNotify(CPWL_List_Notify* pNotify) { m_pNotify = pNotify; } -CFX_PointF CFX_ListCtrl::InToOut(const CFX_PointF& point) const { +CFX_FloatPoint CFX_ListCtrl::InToOut(const CFX_FloatPoint& point) const { CFX_FloatRect rcPlate = GetPlateRect(); - return CFX_PointF(point.x - (m_ptScrollPos.x - rcPlate.left), - point.y - (m_ptScrollPos.y - rcPlate.top)); + + return CFX_FloatPoint(point.x - (m_ptScrollPos.x - rcPlate.left), + point.y - (m_ptScrollPos.y - rcPlate.top)); } -CFX_PointF CFX_ListCtrl::OutToIn(const CFX_PointF& point) const { +CFX_FloatPoint CFX_ListCtrl::OutToIn(const CFX_FloatPoint& point) const { CFX_FloatRect rcPlate = GetPlateRect(); - return CFX_PointF(point.x + (m_ptScrollPos.x - rcPlate.left), - point.y + (m_ptScrollPos.y - rcPlate.top)); + + return CFX_FloatPoint(point.x + (m_ptScrollPos.x - rcPlate.left), + point.y + (m_ptScrollPos.y - rcPlate.top)); } CFX_FloatRect CFX_ListCtrl::InToOut(const CFX_FloatRect& rect) const { - CFX_PointF ptLeftBottom = InToOut(CFX_PointF(rect.left, rect.bottom)); - CFX_PointF ptRightTop = InToOut(CFX_PointF(rect.right, rect.top)); + CFX_FloatPoint ptLeftBottom = InToOut(CFX_FloatPoint(rect.left, rect.bottom)); + CFX_FloatPoint ptRightTop = InToOut(CFX_FloatPoint(rect.right, rect.top)); + return CFX_FloatRect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, ptRightTop.y); } CFX_FloatRect CFX_ListCtrl::OutToIn(const CFX_FloatRect& rect) const { - CFX_PointF ptLeftBottom = OutToIn(CFX_PointF(rect.left, rect.bottom)); - CFX_PointF ptRightTop = OutToIn(CFX_PointF(rect.right, rect.top)); + CFX_FloatPoint ptLeftBottom = OutToIn(CFX_FloatPoint(rect.left, rect.bottom)); + CFX_FloatPoint ptRightTop = OutToIn(CFX_FloatPoint(rect.right, rect.top)); + return CFX_FloatRect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, ptRightTop.y); } -void CFX_ListCtrl::OnMouseDown(const CFX_PointF& point, +void CFX_ListCtrl::OnMouseDown(const CFX_FloatPoint& point, bool bShift, bool bCtrl) { int32_t nHitIndex = GetItemIndex(point); @@ -272,7 +276,7 @@ void CFX_ListCtrl::OnMouseDown(const CFX_PointF& point, ScrollToListItem(nHitIndex); } -void CFX_ListCtrl::OnMouseMove(const CFX_PointF& point, +void CFX_ListCtrl::OnMouseMove(const CFX_FloatPoint& point, bool bShift, bool bCtrl) { int32_t nHitIndex = GetItemIndex(point); @@ -363,7 +367,7 @@ bool CFX_ListCtrl::OnChar(uint16_t nChar, bool bShift, bool bCtrl) { void CFX_ListCtrl::SetPlateRect(const CFX_FloatRect& rect) { CFX_ListContainer::SetPlateRect(rect); m_ptScrollPos.x = rect.left; - SetScrollPos(CFX_PointF(rect.left, rect.top)); + SetScrollPos(CFX_FloatPoint(rect.left, rect.top)); ReArrange(0); InvalidateItem(-1); } @@ -538,7 +542,7 @@ void CFX_ListCtrl::SetScrollInfo() { } } -void CFX_ListCtrl::SetScrollPos(const CFX_PointF& point) { +void CFX_ListCtrl::SetScrollPos(const CFX_FloatPoint& point) { SetScrollPosY(point.y); } @@ -626,8 +630,8 @@ void CFX_ListCtrl::Cancel() { m_aSelItems.DeselectAll(); } -int32_t CFX_ListCtrl::GetItemIndex(const CFX_PointF& point) const { - CFX_PointF pt = OuterToInner(OutToIn(point)); +int32_t CFX_ListCtrl::GetItemIndex(const CFX_FloatPoint& point) const { + CFX_FloatPoint pt = OuterToInner(OutToIn(point)); bool bFirst = true; bool bLast = true; |