From 1e104d5bd4a0befca013cfef3b09d5ea3568dbcc Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 5 Mar 2020 19:08:55 -0500 Subject: [PATCH] Don't promote globals from locals on a different sheet Fixes #4004 --- eeschema/connection_graph.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp index b691a46e20..e685daedff 100644 --- a/eeschema/connection_graph.cpp +++ b/eeschema/connection_graph.cpp @@ -1280,11 +1280,17 @@ void CONNECTION_GRAPH::buildConnectionGraph() if( secondary_name == subgraph->m_driver_connection->Name() ) continue; + bool secondary_is_global = CONNECTION_SUBGRAPH::GetDriverPriority( driver ) + >= CONNECTION_SUBGRAPH::PRIORITY::POWER_PIN; + for( CONNECTION_SUBGRAPH* candidate : global_subgraphs ) { if( candidate == subgraph ) continue; + if( !secondary_is_global && candidate->m_sheet != subgraph->m_sheet ) + continue; + SCH_CONNECTION* conn = candidate->m_driver_connection; if( conn->Name() == secondary_name )