Fix ordering of initialization in length tuner

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9161
This commit is contained in:
Jon Evans 2021-09-14 07:47:53 -04:00
parent 48082e3234
commit 4d478d6f17
1 changed files with 4 additions and 3 deletions

View File

@ -271,9 +271,6 @@ int LENGTH_TUNER_TOOL::MainLoop( const TOOL_EVENT& aEvent )
std::string tool = aEvent.GetCommandStr().get();
frame()->PushTool( tool );
m_lastTuneMode = aEvent.Parameter<PNS::ROUTER_MODE>();
m_router->SetMode( m_lastTuneMode );
auto setCursor =
[&]()
{
@ -286,6 +283,10 @@ int LENGTH_TUNER_TOOL::MainLoop( const TOOL_EVENT& aEvent )
// Set initial cursor
setCursor();
// Router mode must be set after Activate()
m_lastTuneMode = aEvent.Parameter<PNS::ROUTER_MODE>();
m_router->SetMode( m_lastTuneMode );
// Main loop: keep receiving events
while( TOOL_EVENT* evt = Wait() )
{