Selection: non-greedy box selection of wires ends only when dangling

See discussion:
https://gitlab.com/kicad/code/kicad/-/issues/13022#note_1205902448
This commit is contained in:
Mike Williams 2022-12-12 15:04:33 -05:00
parent d824b7f506
commit 243727428a
1 changed files with 7 additions and 3 deletions

View File

@ -1404,20 +1404,24 @@ bool EE_SELECTION_TOOL::selectMultiple()
{
SCH_LINE* line = static_cast<SCH_LINE*>( item );
if( isGreedy && line->HitTest( selectionRect, false ) )
if( ( isGreedy && line->HitTest( selectionRect, false ) )
|| ( selectionRect.Contains( line->GetEndPoint() )
&& selectionRect.Contains( line->GetStartPoint() ) ) )
{
selected = true;
flags |= STARTPOINT | ENDPOINT;
}
else if( !isGreedy )
{
if( selectionRect.Contains( line->GetStartPoint() ) )
if( selectionRect.Contains( line->GetStartPoint() )
&& line->IsStartDangling() )
{
selected = true;
flags |= STARTPOINT;
}
if( selectionRect.Contains( line->GetEndPoint() ) )
if( selectionRect.Contains( line->GetEndPoint() )
&& line->IsEndDangling() )
{
selected = true;
flags |= ENDPOINT;