From 8f646fa9fb5d0acc1cb1531184775ddefabf81c0 Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Thu, 1 Dec 2022 14:59:22 -0500 Subject: [PATCH] Schematic: fix XOR unselecting one end of fully selected line --- eeschema/tools/ee_selection_tool.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 333399e83a..e8848c9881 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -902,9 +902,10 @@ bool EE_SELECTION_TOOL::selectPoint( EE_COLLECTOR& aCollector, const VECTOR2I& a for( int i = 0; i < aCollector.GetCount(); ++i ) { EDA_ITEM_FLAGS flags = 0; + bool isLine = aCollector[i]->Type() == SCH_LINE_T; // Handle line ends specially - if( aCollector[i]->Type() == SCH_LINE_T ) + if( isLine ) { SCH_LINE* line = (SCH_LINE*) aCollector[i]; @@ -916,10 +917,16 @@ bool EE_SELECTION_TOOL::selectPoint( EE_COLLECTOR& aCollector, const VECTOR2I& a flags = STARTPOINT | ENDPOINT; } - if( aSubtract || ( aExclusiveOr && aCollector[i]->IsSelected() ) ) + if( aSubtract + || ( aExclusiveOr && aCollector[i]->IsSelected() + && ( !isLine || ( isLine && aCollector[i]->HasFlag( flags ) ) ) ) ) { aCollector[i]->ClearFlags( flags ); + // Need to update end shadows after ctrl-click unselecting one of two selected endpoints + if( isLine ) + getView()->Update( aCollector[i] ); + if( !aCollector[i]->HasFlag( STARTPOINT ) && !aCollector[i]->HasFlag( ENDPOINT ) ) { unselect( aCollector[i] );