sch selection: fix non-greedy line selection

Make sure we selected at least one end before selecting.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20942
This commit is contained in:
Mike Williams 2025-05-21 08:54:37 -04:00
parent c5326e7fce
commit 2b5b3ffb8d

View File

@ -2297,9 +2297,13 @@ bool SCH_SELECTION_TOOL::selectMultiple()
if( selectionRect.Contains( line->GetEndPoint() ) && line->IsEndDangling() )
flags |= ENDPOINT;
}
}
selectItem( item, flags );
// Only select a line if it at least one point is selected
if( flags & ( STARTPOINT | ENDPOINT ) )
selectItem( item, flags );
}
else
selectItem( item, flags );
item->ClearFlags( SHOW_ELEC_TYPE );
}