Set a reference point for all selection sizes.

Fixes: lp:1829833
* https://bugs.launchpad.net/kicad/+bug/1829833
This commit is contained in:
Jeff Young 2019-05-22 22:09:20 +01:00
parent ecb81426a4
commit 1636405b66
1 changed files with 7 additions and 7 deletions

View File

@ -601,18 +601,18 @@ SELECTION& EE_SELECTION_TOOL::RequestSelection( const KICAD_T aFilterList[] )
m_selection.ClearReferencePoint();
}
if( m_selection.Size() == 1 )
VECTOR2I refP( 0, 0 );
if( m_selection.Size() > 0 )
{
VECTOR2I refP;
if( m_isLibEdit )
refP = static_cast<LIB_ITEM*>( m_selection.GetItem( 0 ) )->GetPosition();
refP = static_cast<LIB_ITEM*>( m_selection.GetTopLeftItem() )->GetPosition();
else
refP = static_cast<SCH_ITEM*>( m_selection.GetItem( 0 ) )->GetPosition();
m_selection.SetReferencePoint( refP );
refP = static_cast<SCH_ITEM*>( m_selection.GetTopLeftItem() )->GetPosition();
}
m_selection.SetReferencePoint( refP );
return m_selection;
}