diff --git a/pcbnew/ratsnest/ratsnest_data.cpp b/pcbnew/ratsnest/ratsnest_data.cpp index 93d0bd6274..d89750163d 100644 --- a/pcbnew/ratsnest/ratsnest_data.cpp +++ b/pcbnew/ratsnest/ratsnest_data.cpp @@ -203,10 +203,28 @@ public: anchorChains[anchors.size() - 1].push_back( n ); } - if( anchors.size() < 2 ) + if( anchors.empty() ) { return; } + else if( anchors.size() == 1 ) + { + // The anchors all have the same position, but may not have overlapping layers. + prev = nullptr; + + for( const std::shared_ptr& n : m_allNodes ) + { + if( prev && !( prev->Parent()->GetLayerSet() & n->Parent()->GetLayerSet() ).any() ) + { + // Use a minimal but non-zero distance or the edge will be ignored + mstEdges.emplace_back( prev, n, 1 ); + } + + prev = n; + } + + return; + } else if( areNodesColinear( anchors ) ) { // special case: all nodes are on the same line - there's no