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
This commit is contained in:
jean-pierre charras 2021-08-07 20:29:49 +02:00
parent 1332208ab1
commit fa82fcb809
2 changed files with 7 additions and 2 deletions

View File

@ -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;

View File

@ -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 )
{