Schematic: don't deselect line ends when right clicking off-selection

This commit is contained in:
Mike Williams 2022-12-22 14:16:38 -05:00
parent 8b7d0d71fb
commit 9b782fa827
2 changed files with 4 additions and 15 deletions

View File

@ -435,22 +435,13 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
else if( !m_selection.GetBoundingBox().Inflate( grid.GetGrid().x, grid.GetGrid().y )
.Contains( evt->Position() ) )
{
EE_SELECTION saved_selection = m_selection;
EE_COLLECTOR collector;
for( EDA_ITEM* item : saved_selection )
RemoveItemFromSel( item, true );
SelectPoint( evt->Position(), { SCH_LOCATE_ANY_T }, nullptr, &selCancelled );
if( m_selection.Empty() )
if( CollectHits( collector, evt->Position(), { SCH_LOCATE_ANY_T } ) )
{
m_selection.SetIsHover( false );
ClearSelection();
for( EDA_ITEM* item : saved_selection )
AddItemToSel( item, true);
}
else
{
SelectPoint( evt->Position(), { SCH_LOCATE_ANY_T }, nullptr, &selCancelled );
m_selection.SetIsHover( true );
}
}

View File

@ -1175,8 +1175,6 @@ int SCH_EDITOR_CONTROL::ClearHighlight( const TOOL_EVENT& aEvent )
int SCH_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent )
{
EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
KIGFX::VIEW_CONTROLS* controls = getViewControls();
VECTOR2D cursorPos = controls->GetCursorPosition( !aEvent.DisableGridSnapping() );
SCHEMATIC& schematic = m_frame->Schematic();
SCH_SCREEN* screen = m_frame->GetCurrentSheet().LastScreen();