Ensure that we are not calculating self-collision

Ratsnest may have connections from a zone to two different items.  This
should be avoided as we never want to draw the ratsnest line with the
same element as start and finish

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17763

(cherry picked from commit 8760519a87)
This commit is contained in:
Seth Hillbrand 2024-04-14 13:47:29 -07:00
parent 4481fcc75e
commit 07b5fd342a
1 changed files with 4 additions and 1 deletions

View File

@ -388,7 +388,10 @@ void RN_NET::OptimizeRNEdges()
{
CN_ZONE_LAYER* zoneLayerB = dynamic_cast<CN_ZONE_LAYER*>( itemB );
if( zoneLayerB && zoneLayerB->Layer() == zoneLayerA->Layer() )
if( !zoneLayerB || zoneLayerB == zoneLayerA )
continue;
if( zoneLayerB->Layer() == zoneLayerA->Layer() )
{
// Process the first matching layer. We don't really care if it's
// the "best" layer or not, as anything will be better than the