From 77284e82c821682cbd8bb9c9ac812664c4f60dfa Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 3 Apr 2019 18:20:14 +0100 Subject: [PATCH] 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 --- pcbnew/tools/drawing_tool.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index f6cf412509..4e6245a440 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -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; }