Take into account scrolling while obtaining absolute mouse pointer position

See #18313.
This commit is contained in:
Artur Wieczorek 2019-01-04 19:24:11 +01:00
parent 659ab78c6d
commit 066c422c81

View File

@ -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;