From 661eed7fed0cef355d96f0c1bca53c3421370414 Mon Sep 17 00:00:00 2001 From: James Jackson Date: Thu, 12 Jan 2023 20:10:23 +0000 Subject: [PATCH] Eeschema: ensure wire / bus auto-start respects bus labels Fixes #13506 and further ensures correct behaviour for heirarchical labels and sheet pins --- eeschema/tools/ee_selection_tool.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 950ae3ee30..917f643cde 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -731,6 +731,16 @@ OPT_TOOL_EVENT EE_SELECTION_TOOL::autostartEvent( TOOL_EVENT* aEvent, EE_GRID_HE else if( line->IsGraphicLine() ) newEvt = EE_ACTIONS::drawLines.MakeEvent(); } + else if( aItem->Type() == SCH_LABEL_T || aItem->Type() == SCH_HIER_LABEL_T + || aItem->Type() == SCH_SHEET_PIN_T ) + { + SCH_LABEL_BASE* label = static_cast( aItem ); + SCH_CONNECTION possibleConnection( label->Schematic()->ConnectionGraph() ); + possibleConnection.ConfigureFromLabel( label->GetText() ); + + if( possibleConnection.IsBus() ) + newEvt = EE_ACTIONS::drawBus.MakeEvent(); + } newEvt->SetMousePosition( pos ); newEvt->SetHasPosition( true );