Prevent ops on empty selection

Fixes https://gitlab.com/kicad/code/kicad/issues/10164
This commit is contained in:
Seth Hillbrand 2022-01-01 15:28:25 -08:00
parent 3453bf3f88
commit bd75cffff3
1 changed files with 8 additions and 0 deletions

View File

@ -1453,6 +1453,10 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
true /* prompt user regarding locked items */ );
}
// Did we filter everything out? If so, don't try to operate further
if( selection.Empty() )
return 0;
updateModificationPoint( selection );
VECTOR2I refPt = selection.GetReferencePoint();
@ -2251,6 +2255,10 @@ bool EDIT_TOOL::updateModificationPoint( PCB_SELECTION& aSelection )
if( m_dragging && aSelection.HasReferencePoint() )
return false;
// Can't modify an empty group
if( aSelection.Empty() )
return false;
// When there is only one item selected, the reference point is its position...
if( aSelection.Size() == 1 )
{