From 1ee579c82100ae203b264b4ad87b9450b7f35fa6 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 6 Oct 2018 21:38:37 -0700 Subject: [PATCH] pcbnew: Set graphic line width based on layer Get the board settings when changing the drawing layer. These include default line thickness that should be updated. Fixes: lp:1796489 * https://bugs.launchpad.net/kicad/+bug/1796489 --- pcbnew/tools/drawing_tool.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 6e1c286fa1..8ae0504842 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -1064,7 +1064,9 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic, } else if( evt->IsAction( &PCB_ACTIONS::layerChanged ) ) { + m_lineWidth = getSegmentWidth( getDrawingLayer() ); aGraphic->SetLayer( getDrawingLayer() ); + aGraphic->SetWidth( m_lineWidth ); m_view->Update( &preview ); frame()->SetMsgPanel( aGraphic ); } @@ -1266,6 +1268,14 @@ bool DRAWING_TOOL::drawArc( DRAWSEGMENT*& aGraphic ) aGraphic = nullptr; break; } + else if( evt->IsAction( &PCB_ACTIONS::layerChanged ) ) + { + m_lineWidth = getSegmentWidth( getDrawingLayer() ); + aGraphic->SetLayer( getDrawingLayer() ); + aGraphic->SetWidth( m_lineWidth ); + m_view->Update( &preview ); + frame()->SetMsgPanel( aGraphic ); + } else if( evt->IsClick( BUT_RIGHT ) ) { m_menu.ShowContextMenu();