aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/ScintillaWin.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2019-03-18 19:22:38 +1100
committerNeil <nyamatongwe@gmail.com>2019-03-18 19:22:38 +1100
commit983d5165878df0190964a8f903c24055f9144612 (patch)
tree8f88b9eecbb4ee07725af5bafed081c68a453016 /win32/ScintillaWin.cxx
parentb52af20e7318e19b2becf5b191d22d6ccb7139b2 (diff)
downloadscintilla-mirror-983d5165878df0190964a8f903c24055f9144612.tar.gz
Add some operators to Point to simplify client code.
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r--win32/ScintillaWin.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index 0ea2362e1..6008fd51b 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -627,8 +627,9 @@ HWND ScintillaWin::MainHWND() const noexcept {
}
bool ScintillaWin::DragThreshold(Point ptStart, Point ptNow) {
- const int xMove = static_cast<int>(std::abs(ptStart.x - ptNow.x));
- const int yMove = static_cast<int>(std::abs(ptStart.y - ptNow.y));
+ const Point ptDifference = ptStart - ptNow;
+ const XYPOSITION xMove = std::trunc(std::abs(ptDifference.x));
+ const XYPOSITION yMove = std::trunc(std::abs(ptDifference.y));
return (xMove > ::GetSystemMetrics(SM_CXDRAG)) ||
(yMove > ::GetSystemMetrics(SM_CYDRAG));
}
@@ -1434,7 +1435,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
// Windows might send WM_MOUSEMOVE even though the mouse has not been moved:
// http://blogs.msdn.com/b/oldnewthing/archive/2003/10/01/55108.aspx
- if (ptMouseLast.x != pt.x || ptMouseLast.y != pt.y) {
+ if (ptMouseLast != pt) {
SetTrackMouseLeaveEvent(true);
ButtonMoveWithModifiers(pt, ::GetMessageTime(), MouseModifiers(wParam));
}