Fix window/crossed selection mode recognition in flipped view
Fixes: lp:1767233
This commit is contained in:
parent
7395949ae0
commit
5ac4dbe641
|
@ -123,7 +123,13 @@ void SELECTION_AREA::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
|||
gal.SetIsFill( true );
|
||||
|
||||
gal.SetLineWidth( 1.0 / gal.GetWorldScale() );
|
||||
|
||||
// Set the stroke color to indicate window or crossing selection
|
||||
gal.SetStrokeColor( ( m_origin.x <= m_end.x ) ? scheme.outline_l2r : scheme.outline_r2l );
|
||||
bool windowSelection = ( m_origin.x <= m_end.x ) ? true : false;
|
||||
|
||||
if( aView->IsMirroredX() )
|
||||
windowSelection = !windowSelection;
|
||||
|
||||
gal.SetStrokeColor( windowSelection ? scheme.outline_l2r : scheme.outline_r2l );
|
||||
gal.DrawRectangle( m_origin, m_end );
|
||||
}
|
||||
|
|
|
@ -591,6 +591,15 @@ bool SELECTION_TOOL::selectMultiple()
|
|||
int width = area.GetEnd().x - area.GetOrigin().x;
|
||||
int height = area.GetEnd().y - area.GetOrigin().y;
|
||||
|
||||
/* Selection mode depends on direction of drag-selection:
|
||||
* Left > Right : Select objects that are fully enclosed by selection
|
||||
* Right > Left : Select objects that are crossed by selection
|
||||
*/
|
||||
bool windowSelection = width >= 0 ? true : false;
|
||||
|
||||
if( view->IsMirroredX() )
|
||||
windowSelection = !windowSelection;
|
||||
|
||||
// Construct an EDA_RECT to determine BOARD_ITEM selection
|
||||
EDA_RECT selectionRect( wxPoint( area.GetOrigin().x, area.GetOrigin().y ),
|
||||
wxSize( width, height ) );
|
||||
|
@ -604,12 +613,7 @@ bool SELECTION_TOOL::selectMultiple()
|
|||
if( !item || !selectable( item ) )
|
||||
continue;
|
||||
|
||||
/* Selection mode depends on direction of drag-selection:
|
||||
* Left > Right : Select objects that are fully enclosed by selection
|
||||
* Right > Left : Select objects that are crossed by selection
|
||||
*/
|
||||
|
||||
if( width >= 0 )
|
||||
if( windowSelection )
|
||||
{
|
||||
if( selectionBox.Contains( item->ViewBBox() ) )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue