Fix ordering of initialization in length tuner
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9161
This commit is contained in:
parent
48082e3234
commit
4d478d6f17
|
@ -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() )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue