diff options
Diffstat (limited to 'win32')
| -rw-r--r-- | win32/PlatWin.cxx | 4 | ||||
| -rw-r--r-- | win32/ScintillaWin.cxx | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 1c937a194..20fcdbfd4 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -2385,9 +2385,7 @@ void ListBoxX::ResizeToCursor() { PRectangle rc = GetPosition(); POINT ptw; ::GetCursorPos(&ptw); - Point pt = Point::FromInts(ptw.x, ptw.y); - pt.x += dragOffset.x; - pt.y += dragOffset.y; + const Point pt = Point::FromInts(ptw.x, ptw.y) + dragOffset; switch (resizeHit) { case HTLEFT: diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index d4f9a7a14..b1f0412bd 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)); } @@ -1418,7 +1419,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)); } |
