Remove SashHitTest() "tolerance" parameter
Mouse events (LeftDown in particular) will only occur if the mouse is over the sash, so it does not make sense to have a fudge factor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73111 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
bea20f8d7a
commit
f3ddefc1ad
@ -212,7 +212,7 @@ public:
|
||||
virtual void DrawSashTracker(int x, int y);
|
||||
|
||||
// Tests for x, y over sash
|
||||
virtual bool SashHitTest(int x, int y, int tolerance = 5);
|
||||
virtual bool SashHitTest(int x, int y);
|
||||
|
||||
// Resizes subwindows
|
||||
virtual void SizeWindows();
|
||||
|
@ -323,7 +323,7 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
|
||||
} // left up && dragging
|
||||
else if ((event.Moving() || event.Leaving() || event.Entering()) && (m_dragMode == wxSPLIT_DRAG_NONE))
|
||||
{
|
||||
if ( event.Leaving() || !SashHitTest(x, y, 0) )
|
||||
if ( event.Leaving() || !SashHitTest(x, y) )
|
||||
OnLeaveSash();
|
||||
else
|
||||
OnEnterSash();
|
||||
@ -484,16 +484,15 @@ void wxSplitterWindow::SetSashGravity(double gravity)
|
||||
m_sashGravity = gravity;
|
||||
}
|
||||
|
||||
bool wxSplitterWindow::SashHitTest(int x, int y, int tolerance)
|
||||
bool wxSplitterWindow::SashHitTest(int x, int y)
|
||||
{
|
||||
if ( m_windowTwo == NULL || m_sashPosition == 0)
|
||||
return false; // No sash
|
||||
|
||||
int z = m_splitMode == wxSPLIT_VERTICAL ? x : y;
|
||||
int hitMin = m_sashPosition - tolerance;
|
||||
int hitMax = m_sashPosition + GetSashSize() - 1 + tolerance;
|
||||
int hitMax = m_sashPosition + GetSashSize() - 1;
|
||||
|
||||
return z >= hitMin && z <= hitMax;
|
||||
return z >= m_sashPosition && z <= hitMax;
|
||||
}
|
||||
|
||||
void wxSplitterWindow::SetSashInvisible(bool invisible)
|
||||
@ -1047,7 +1046,7 @@ void wxSplitterWindow::OnSetCursor(wxSetCursorEvent& event)
|
||||
// and like this we explicitly say that our cursor should not be used for
|
||||
// children windows which overlap us
|
||||
|
||||
if ( SashHitTest(event.GetX(), event.GetY(), 0) )
|
||||
if ( SashHitTest(event.GetX(), event.GetY()) )
|
||||
{
|
||||
// default processing is ok
|
||||
event.Skip();
|
||||
|
Loading…
Reference in New Issue
Block a user