From c5c5a3fe9168682b59bcf0847586af9ea7c0f903 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 17 Nov 2022 05:30:55 +0500 Subject: [PATCH] Use a single-shot timer for auto-panning. Fixes https://gitlab.com/kicad/code/kicad/issues/11425 --- common/view/wx_view_controls.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/view/wx_view_controls.cpp b/common/view/wx_view_controls.cpp index f3d92e9f61..b94e2d6eba 100644 --- a/common/view/wx_view_controls.cpp +++ b/common/view/wx_view_controls.cpp @@ -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; }