Schematic: don't require cursor on selected net to assign netclass
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13199
This commit is contained in:
parent
bf5fd38bf7
commit
3037f2b444
|
@ -1187,14 +1187,28 @@ int SCH_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent )
|
||||||
m_frame->RecalculateConnections( NO_CLEANUP );
|
m_frame->RecalculateConnections( NO_CLEANUP );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove selection in favor of highlighting so the whole net is highlighted
|
const SCH_CONNECTION* conn = nullptr;
|
||||||
selectionTool->ClearSelection();
|
VECTOR2D connPos;
|
||||||
highlightNet( m_toolMgr, cursorPos );
|
|
||||||
|
|
||||||
const SCH_CONNECTION* conn = m_frame->GetHighlightedConnection();
|
for( EDA_ITEM* item : selectionTool->GetSelection() )
|
||||||
|
{
|
||||||
|
conn = static_cast<SCH_ITEM*>( item )->Connection();
|
||||||
|
connPos = item->GetPosition();
|
||||||
|
|
||||||
if( conn )
|
if( conn )
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !conn )
|
||||||
{
|
{
|
||||||
|
m_frame->ShowInfoBarError( _( "No net selected." ) );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove selection in favor of highlighting so the whole net is highlighted
|
||||||
|
selectionTool->ClearSelection();
|
||||||
|
highlightNet( m_toolMgr, connPos );
|
||||||
|
|
||||||
wxString netName = conn->Name();
|
wxString netName = conn->Name();
|
||||||
|
|
||||||
if( conn->IsBus() )
|
if( conn->IsBus() )
|
||||||
|
@ -1304,7 +1318,6 @@ int SCH_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent )
|
||||||
return 0;
|
return 0;
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
highlightNet( m_toolMgr, CLEAR );
|
highlightNet( m_toolMgr, CLEAR );
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue