Replace more-than-half-line algorithm with greedy/stingy check.

Fixes https://gitlab.com/kicad/code/kicad/issues/10860
This commit is contained in:
Jeff Young 2022-10-10 20:23:21 +01:00
parent cb20a39693
commit 1825905011
1 changed files with 1 additions and 6 deletions

View File

@ -1353,14 +1353,9 @@ bool EE_SELECTION_TOOL::selectMultiple()
if( selectionRect.Contains( line->GetEndPoint() ) || isGreedy ) if( selectionRect.Contains( line->GetEndPoint() ) || isGreedy )
flags |= ENDPOINT; flags |= ENDPOINT;
// If no ends were selected, select whole line (both ends) // If no ends were selected, select whole line (both ends)
// Also select both ends if the selection overlaps the midpoint if( !( flags & STARTPOINT ) && !( flags & ENDPOINT ) )
if( ( !( flags & STARTPOINT ) && !( flags & ENDPOINT ) )
|| selectionRect.Contains( line->GetMidPoint() ) )
{
flags = STARTPOINT | ENDPOINT; flags = STARTPOINT | ENDPOINT;
}
} }
if( m_subtractive || ( m_exclusive_or && aItem->IsSelected() ) ) if( m_subtractive || ( m_exclusive_or && aItem->IsSelected() ) )