From 0e6cf3f56e4a80cd8a4d0bb7d3f75a63a0101b1c Mon Sep 17 00:00:00 2001 From: Tomasz Wlostowski Date: Thu, 11 Feb 2021 23:07:15 +0100 Subject: [PATCH] router: fix board edge clearance queries Fixes: #7254 --- pcbnew/router/pns_kicad_iface.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 6f4b89f84e..74f326a1b1 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -173,7 +173,14 @@ bool isCopper( const PNS::ITEM* aItem ) bool isEdge( const PNS::ITEM* aItem ) { - return aItem->Layer() == Edge_Cuts || aItem->Layer() == Margin; + const BOARD_ITEM *parent = aItem->Parent(); + + if( parent ) + { + return parent->GetLayer() == Edge_Cuts || parent->GetLayer () == Margin; + } + + return false; } @@ -1616,7 +1623,7 @@ void PNS_KICAD_IFACE::SetView( KIGFX::VIEW* aView ) delete m_debugDecorator; - auto dec = new PNS_PCBNEW_DEBUG_DECORATOR( m_view ); + auto dec = new PNS_PCBNEW_DEBUG_DECORATOR( ); m_debugDecorator = dec; if( ADVANCED_CFG::GetCfg().m_ShowRouterDebugGraphics )