Fix unselected event not firing when clicking empty space

This commit is contained in:
Jon Evans 2020-06-26 21:57:16 -04:00
parent 17adb6c3c6
commit 129c16cf7d
1 changed files with 4 additions and 3 deletions

View File

@ -456,6 +456,9 @@ bool SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag,
} }
} }
bool anyAdded = false;
bool anySubtracted = false;
if( !m_additive && !m_subtractive && !m_exclusive_or ) if( !m_additive && !m_subtractive && !m_exclusive_or )
{ {
if( m_selection.GetSize() > 0 ) if( m_selection.GetSize() > 0 )
@ -463,12 +466,10 @@ bool SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag,
// Don't fire an event now as it will end up redundant if we fire a SelectedEvent // Don't fire an event now as it will end up redundant if we fire a SelectedEvent
// or an UnselectedEvent. // or an UnselectedEvent.
ClearSelection( true /*quiet mode*/ ); ClearSelection( true /*quiet mode*/ );
anySubtracted = true;
} }
} }
bool anyAdded = false;
bool anySubtracted = false;
if( collector.GetCount() > 0 ) if( collector.GetCount() > 0 )
{ {
for( int i = 0; i < collector.GetCount(); ++i ) for( int i = 0; i < collector.GetCount(); ++i )