PCB Router: return to original active layer after routing

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/12313
(cherry picked from commit fa3e9efdce)
This commit is contained in:
Mike Williams 2022-08-31 11:43:59 -04:00 committed by Seth Hillbrand
parent 6ca2f6a6e1
commit 6289a82a18
2 changed files with 3 additions and 0 deletions

View File

@ -1117,6 +1117,7 @@ bool ROUTER_TOOL::prepareInteractive()
return false;
}
m_originalActiveLayer = editFrame->GetActiveLayer();
editFrame->SetActiveLayer( ToLAYER_ID( routingLayer ) );
if( !getView()->IsLayerVisible( routingLayer ) )
@ -1176,6 +1177,7 @@ bool ROUTER_TOOL::finishInteractive()
m_startItem = nullptr;
m_endItem = nullptr;
frame()->SetActiveLayer( m_originalActiveLayer );
UpdateMessagePanel();
frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
controls()->SetAutoPan( false );

View File

@ -92,6 +92,7 @@ private:
int m_lastTargetLayer;
bool m_inRouterTool; // Re-entrancy guard
PCB_LAYER_ID m_originalActiveLayer;
};
#endif