Use a single-shot timer for auto-panning.

Fixes https://gitlab.com/kicad/code/kicad/issues/11425
This commit is contained in:
Alex 2022-11-17 05:30:55 +05:00
parent 5e7c4b734c
commit c5c5a3fe91
1 changed files with 3 additions and 1 deletions

View File

@ -580,6 +580,8 @@ void WX_VIEW_CONTROLS::onTimer( wxTimerEvent& aEvent )
m_view->SetCenter( m_view->GetCenter() + dir );
refreshMouse();
m_panTimer.Start();
}
break;
@ -907,7 +909,7 @@ bool WX_VIEW_CONTROLS::handleAutoPanning( const wxMouseEvent& aEvent )
if( borderHit )
{
setState( AUTO_PANNING );
m_panTimer.Start( (int) ( 250.0 / 60.0 ) );
m_panTimer.Start( (int) ( 250.0 / 60.0 ), true );
return true;
}