Schematic: make grabbing whole lines more intuitive

Selecting end and midpoint will select whole line. Some changes for
orthogonal dragging made this worse than in 6.0.

Improves, but does not fully resolve:
https://gitlab.com/kicad/code/kicad/-/issues/10860
This commit is contained in:
Mike Williams 2022-02-16 09:15:13 -05:00 committed by Seth Hillbrand
parent b1bd8421e0
commit 567168fffc
2 changed files with 7 additions and 1 deletions

View File

@ -122,6 +122,8 @@ public:
VECTOR2I GetStartPoint() const { return m_start; }
void SetStartPoint( const VECTOR2I& aPosition ) { m_start = aPosition; }
VECTOR2I GetMidPoint() const { return ( m_start + m_end ) / 2; }
VECTOR2I GetEndPoint() const { return m_end; }
void SetEndPoint( const VECTOR2I& aPosition ) { m_end = aPosition; }

View File

@ -1270,9 +1270,13 @@ bool EE_SELECTION_TOOL::selectMultiple()
line->SetFlags( ENDPOINT );
// If no ends were selected, select whole line (both ends)
if( !line->HasFlag( STARTPOINT ) && !line->HasFlag( ENDPOINT ) )
// Also select both ends if the selection overlaps the midpoint
if( ( !line->HasFlag( STARTPOINT ) && !line->HasFlag( ENDPOINT ) )
|| selectionRect.Contains( line->GetMidPoint() ) )
{
line->SetFlags( STARTPOINT | ENDPOINT );
}
}
anyAdded = true;
}