Split selecteditemmodified to a selecteditemmoved to reduce updatemsgpanel spam

This commit is contained in:
Marek Roszko 2020-08-15 14:18:04 -04:00 committed by Wayne Stambaugh
parent 3696064f6f
commit a417da4ce0
4 changed files with 8 additions and 2 deletions

View File

@ -623,4 +623,5 @@ const TOOL_EVENT EVENTS::UnselectedEvent( TC_MESSAGE, TA_ACTION, "common.Interac
const TOOL_EVENT EVENTS::ClearedEvent( TC_MESSAGE, TA_ACTION, "common.Interactive.cleared" );
const TOOL_EVENT EVENTS::SelectedItemsModified( TC_MESSAGE, TA_ACTION, "common.Interactive.modified" );
const TOOL_EVENT EVENTS::SelectedItemsMoved( TC_MESSAGE, TA_ACTION, "common.Interactive.moved" );

View File

@ -204,7 +204,11 @@ public:
const static TOOL_EVENT UnselectedEvent;
const static TOOL_EVENT ClearedEvent;
//< Selected item had a property changed (except movement)
const static TOOL_EVENT SelectedItemsModified;
//< Selected items were moved, this can be very high frequency on the canvas, use with care
const static TOOL_EVENT SelectedItemsMoved;
};
#endif // __ACTIONS_H

View File

@ -436,6 +436,8 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, bool aPickReference )
if( !item->GetParent() || !item->GetParent()->IsSelected() )
static_cast<BOARD_ITEM*>( item )->Move( movement );
}
m_toolMgr->PostEvent( EVENTS::SelectedItemsMoved );
}
else if( !m_dragging ) // Prepare to start dragging
{
@ -546,8 +548,6 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, bool aPickReference )
prevPos = m_cursor;
controls->SetAutoPan( true );
// only post event while we arent dragging
m_toolMgr->PostEvent( EVENTS::SelectedItemsModified );
}

View File

@ -2606,4 +2606,5 @@ void SELECTION_TOOL::setTransitions()
Go( &SELECTION_TOOL::selectSameSheet, PCB_ACTIONS::selectSameSheet.MakeEvent() );
Go( &SELECTION_TOOL::selectSheetContents, PCB_ACTIONS::selectOnSheetFromEeschema.MakeEvent() );
Go( &SELECTION_TOOL::updateSelection, EVENTS::SelectedItemsModified );
Go( &SELECTION_TOOL::updateSelection, EVENTS::SelectedItemsMoved );
}