From 066c422c81961dbd64b99d4fe0820c2570277b6c Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 4 Jan 2019 19:24:11 +0100 Subject: [PATCH] Take into account scrolling while obtaining absolute mouse pointer position See #18313. --- src/propgrid/propgrid.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 01519395c4..58edff27e2 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -5471,9 +5471,12 @@ bool wxPropertyGrid::OnMouseChildCommon( wxMouseEvent &event, int* px, int *py ) int splitterX = GetSplitterPosition(); wxRect r = topCtrlWnd->GetRect(); + int ux, uy; + CalcUnscrolledPosition(r.x + x, r.y + y, &ux, &uy); + if ( !m_dragStatus && - x > (splitterX-r.x+wxPG_SPLITTERX_DETECTMARGIN2) && - y >= 0 && y < r.height \ + ux > (splitterX + wxPG_SPLITTERX_DETECTMARGIN2) && + y >= 0 && y < r.height ) { if ( m_curcursor != wxCURSOR_ARROW ) CustomSetCursor ( wxCURSOR_ARROW ); @@ -5481,8 +5484,14 @@ bool wxPropertyGrid::OnMouseChildCommon( wxMouseEvent &event, int* px, int *py ) } else { - CalcUnscrolledPosition( event.m_x + r.x, event.m_y + r.y, \ - px, py ); + if ( px ) + { + *px = ux; + } + if ( py ) + { + *py = uy; + } return true; } return false;