Replace switch-to-non-copper-layer for DIMENSION and POLYGON.

These still aren't handled by DRC.

Fixes: lp:1796500
* https://bugs.launchpad.net/kicad/+bug/1796500
This commit is contained in:
Jeff Young 2019-04-03 18:20:14 +01:00
parent 75366bce74
commit 77284e82c8
1 changed files with 16 additions and 1 deletions

View File

@ -1808,7 +1808,22 @@ int DRAWING_TOOL::getSegmentWidth( PCB_LAYER_ID aLayer ) const
PCB_LAYER_ID DRAWING_TOOL::getDrawingLayer() const
{
return m_frame->GetActiveLayer();
PCB_LAYER_ID layer = m_frame->GetActiveLayer();
if( ( GetDrawingMode() == MODE::DIMENSION || GetDrawingMode() == MODE::GRAPHIC_POLYGON )
&& IsCopperLayer( layer ) )
{
if( layer == F_Cu )
layer = F_SilkS;
else if( layer == B_Cu )
layer = B_SilkS;
else
layer = Dwgs_User;
m_frame->SetActiveLayer( layer );
}
return layer;
}