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.
This commit is contained in:
Seth Hillbrand 2020-06-24 17:16:07 -07:00
parent b02d3f683f
commit a893d19d26
1 changed files with 11 additions and 0 deletions

View File

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