summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_spinbutton.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-21 14:27:59 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-21 20:44:29 +0000
commitb45ea1fce52d93615470bab8b671cba5907fb01e (patch)
tree15153c437a253f73b3f5bb154a294ace77fe2c6d /xfa/fwl/cfwl_spinbutton.cpp
parent37a35df8c878d6e21a62ce0dfd2d480997d9e86c (diff)
downloadpdfium-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_spinbutton.cpp')
-rw-r--r--xfa/fwl/cfwl_spinbutton.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/xfa/fwl/cfwl_spinbutton.cpp b/xfa/fwl/cfwl_spinbutton.cpp
index 140cdd50be..6e58b69baf 100644
--- a/xfa/fwl/cfwl_spinbutton.cpp
+++ b/xfa/fwl/cfwl_spinbutton.cpp
@@ -66,14 +66,14 @@ void CFWL_SpinButton::Update() {
}
}
-FWL_WidgetHit CFWL_SpinButton::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
- if (m_rtClient.Contains(fx, fy))
+FWL_WidgetHit CFWL_SpinButton::HitTest(const CFX_PointF& point) {
+ if (m_rtClient.Contains(point))
return FWL_WidgetHit::Client;
- if (HasBorder() && (m_rtClient.Contains(fx, fy)))
+ if (HasBorder() && (m_rtClient.Contains(point)))
return FWL_WidgetHit::Border;
- if (m_rtUpButton.Contains(fx, fy))
+ if (m_rtUpButton.Contains(point))
return FWL_WidgetHit::UpButton;
- if (m_rtDnButton.Contains(fx, fy))
+ if (m_rtDnButton.Contains(point))
return FWL_WidgetHit::DownButton;
return FWL_WidgetHit::Unknown;
}
@@ -201,10 +201,8 @@ void CFWL_SpinButton::OnLButtonDown(CFWL_MessageMouse* pMsg) {
SetGrab(true);
SetFocus(true);
- bool bUpPress =
- (m_rtUpButton.Contains(pMsg->m_fx, pMsg->m_fy) && IsUpButtonEnabled());
- bool bDnPress =
- (m_rtDnButton.Contains(pMsg->m_fx, pMsg->m_fy) && IsDownButtonEnabled());
+ bool bUpPress = m_rtUpButton.Contains(pMsg->m_pos) && IsUpButtonEnabled();
+ bool bDnPress = m_rtDnButton.Contains(pMsg->m_pos) && IsDownButtonEnabled();
if (!bUpPress && !bDnPress)
return;
if (bUpPress) {
@@ -255,7 +253,7 @@ void CFWL_SpinButton::OnMouseMove(CFWL_MessageMouse* pMsg) {
bool bRepaint = false;
CFX_RectF rtInvlidate;
- if (m_rtUpButton.Contains(pMsg->m_fx, pMsg->m_fy)) {
+ if (m_rtUpButton.Contains(pMsg->m_pos)) {
if (IsUpButtonEnabled()) {
if (m_dwUpState == CFWL_PartState_Hovered) {
m_dwUpState = CFWL_PartState_Hovered;
@@ -275,7 +273,7 @@ void CFWL_SpinButton::OnMouseMove(CFWL_MessageMouse* pMsg) {
if (!IsDownButtonEnabled())
DisableButton();
- } else if (m_rtDnButton.Contains(pMsg->m_fx, pMsg->m_fy)) {
+ } else if (m_rtDnButton.Contains(pMsg->m_pos)) {
if (IsDownButtonEnabled()) {
if (m_dwDnState != CFWL_PartState_Hovered) {
m_dwDnState = CFWL_PartState_Hovered;