From 3a9ed47bf0e9bf62110d60465384ef4bbdc184e9 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 27 Oct 2022 22:54:36 -0400 Subject: [PATCH] Prioritize power symbols over hidden power pins on regular symbols Fixes https://gitlab.com/kicad/code/kicad/-/issues/8400 --- eeschema/connection_graph.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp index 5b24dc02b9..8343c6c030 100644 --- a/eeschema/connection_graph.cpp +++ b/eeschema/connection_graph.cpp @@ -145,6 +145,22 @@ bool CONNECTION_SUBGRAPH::ResolveDrivers( bool aCheckMultipleDrivers ) if( ac->IsBus() && bc->IsBus() ) return bc->IsSubsetOf( ac ); + // Ensure we don't pick a hidden power pin on a regular symbol over + // one on a power symbol + if( a->Type() == SCH_PIN_T && b->Type() == SCH_PIN_T ) + { + SCH_PIN* pa = static_cast( a ); + SCH_PIN* pb = static_cast( b ); + + bool aPower = pa->GetLibPin()->GetParent()->IsPower(); + bool bPower = pb->GetLibPin()->GetParent()->IsPower(); + + if( aPower && !bPower ) + return true; + else if( bPower && !aPower ) + return false; + } + wxString a_name = GetNameForDriver( a ); wxString b_name = GetNameForDriver( b ); bool a_lowQualityName = a_name.Contains( "-Pad" );