Fix layer ordering logic for non-copper layers

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6817
This commit is contained in:
Jon Evans 2020-12-23 22:09:09 -05:00
parent 8a2667c4c3
commit d0429ced8d
1 changed files with 3 additions and 5 deletions

View File

@ -353,14 +353,12 @@ void PCB_DRAW_PANEL_GAL::SetTopLayer( PCB_LAYER_ID aLayer )
m_view->SetTopLayer( ZONE_LAYER_FOR( layer ) ); m_view->SetTopLayer( ZONE_LAYER_FOR( layer ) );
} }
// Move the active layer to the top. Dwgs_User and Cmts_User are simply the first two // Move the active layer to the top of the stack but below all the overlay layers
// "real" layers in the layer ordering, so they are used as "on top" -- overlay layers
// should still be above them.
if( !IsCopperLayer( aLayer ) ) if( !IsCopperLayer( aLayer ) )
{ {
m_view->SetLayerOrder( aLayer, m_view->GetLayerOrder( Dwgs_User ) ); m_view->SetLayerOrder( aLayer, m_view->GetLayerOrder( LAYER_MARKER_SHADOWS ) + 1 );
m_view->SetLayerOrder( ZONE_LAYER_FOR( aLayer ), m_view->SetLayerOrder( ZONE_LAYER_FOR( aLayer ),
m_view->GetLayerOrder( Cmts_User ) ); m_view->GetLayerOrder( LAYER_MARKER_SHADOWS ) + 2 );
} }
} }
else if( IsCopperLayer( aLayer ) ) else if( IsCopperLayer( aLayer ) )