From fa82fcb809409ba011fa03cc8fef5648550cea97 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 7 Aug 2021 20:29:49 +0200 Subject: [PATCH] Router tool: ensure a internal layer exists when placing a microvia. Fix also a minor compil warning. Fixes #8931 https://gitlab.com/kicad/code/kicad/issues/8931 --- pcbnew/dialogs/dialog_pad_properties.h | 3 ++- pcbnew/router/router_tool.cpp | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pcbnew/dialogs/dialog_pad_properties.h b/pcbnew/dialogs/dialog_pad_properties.h index 5b0b95ce59..5d1a1e33b5 100644 --- a/pcbnew/dialogs/dialog_pad_properties.h +++ b/pcbnew/dialogs/dialog_pad_properties.h @@ -153,7 +153,8 @@ private: UNIT_BINDER m_offsetX, m_offsetY; UNIT_BINDER m_padToDie; UNIT_BINDER m_trapDelta; - UNIT_BINDER m_cornerRatio, m_cornerRadius; + UNIT_BINDER m_cornerRadius; + UNIT_BINDER m_cornerRatio; UNIT_BINDER m_chamferRatio; UNIT_BINDER m_mixedCornerRatio, m_mixedChamferRatio; UNIT_BINDER m_holeX, m_holeY; diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 4e6b92c135..8d89ab2aa0 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -890,7 +890,11 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia ) { // front-side microvia currentLayer = F_Cu; - targetLayer = In1_Cu; + + if( layerCount > 2 ) // Ensure the inner layer In1_Cu exists + targetLayer = In1_Cu; + else + targetLayer = B_Cu; } else if( currentLayer == B_Cu || currentLayer == layerCount - 2 ) {