pcbnew: Allow slow ratsnest to turn off

Depending on where you move the selection, the slow ratsnest might turn
on.  This prevents that setting from being sticky, reverting to smooth
movement.

(cherry picked from commit a893d19d26)

Fixes https://gitlab.com/kicad/code/kicad/issues/1909
This commit is contained in:
Seth Hillbrand 2020-06-24 17:16:07 -07:00
parent 7f287cb8f9
commit 7194e25bba
1 changed files with 11 additions and 0 deletions

View File

@ -1243,8 +1243,19 @@ int PCB_EDITOR_CONTROL::HideSelectionRatsnest( const TOOL_EVENT& aEvent )
void PCB_EDITOR_CONTROL::ratsnestTimer( wxTimerEvent& aEvent ) void PCB_EDITOR_CONTROL::ratsnestTimer( wxTimerEvent& aEvent )
{ {
auto connectivity = getModel<BOARD>()->GetConnectivity();
m_ratsnestTimer.Stop(); m_ratsnestTimer.Stop();
/// Check how much time does it take to calculate ratsnest
PROF_COUNTER counter;
calculateSelectionRatsnest(); calculateSelectionRatsnest();
counter.Stop();
/// If the ratsnest is fast enough, turn the slow ratsnest off
if( counter.msecs() <= 25 )
m_slowRatsnest = false;
static_cast<PCB_DRAW_PANEL_GAL*>( m_frame->GetGalCanvas() )->RedrawRatsnest(); static_cast<PCB_DRAW_PANEL_GAL*>( m_frame->GetGalCanvas() )->RedrawRatsnest();
m_frame->GetGalCanvas()->Refresh(); m_frame->GetGalCanvas()->Refresh();
} }