Eeschema: ensure wire / bus auto-start respects bus labels

Fixes #13506 and further ensures correct behaviour for heirarchical labels and sheet pins
This commit is contained in:
James Jackson 2023-01-12 20:10:23 +00:00 committed by JamesJCode
parent e9da3e5ae9
commit 661eed7fed
1 changed files with 10 additions and 0 deletions

View File

@ -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<SCH_LABEL_BASE*>( 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 );