Stops autopanning on left mouse button release.

This commit is contained in:
Maciej Suminski 2013-09-09 13:57:56 +02:00
parent 5e3ab406e2
commit cba1e0bf91
1 changed files with 9 additions and 0 deletions

View File

@ -44,6 +44,10 @@ WX_VIEW_CONTROLS::WX_VIEW_CONTROLS( VIEW* aView, wxWindow* aParentPanel ) :
WX_VIEW_CONTROLS::onButton ), NULL, this );
m_parentPanel->Connect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler(
WX_VIEW_CONTROLS::onButton ), NULL, this );
m_parentPanel->Connect( wxEVT_LEFT_UP, wxMouseEventHandler(
WX_VIEW_CONTROLS::onButton ), NULL, this );
m_parentPanel->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler(
WX_VIEW_CONTROLS::onButton ), NULL, this );
#if defined _WIN32 || defined _WIN64
m_parentPanel->Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler(
WX_VIEW_CONTROLS::onEnter ), NULL, this );
@ -151,6 +155,11 @@ void WX_VIEW_CONTROLS::onButton( wxMouseEvent& aEvent )
m_lookStartPoint = m_view->GetCenter();
m_state = DRAG_PANNING;
}
if( aEvent.LeftUp() )
{
m_state = IDLE; // Stop autopanning when user release left mouse button
}
break;
case DRAG_PANNING: