Don't spam the event processor with SelectedEvents
If we are appending a sheet, this can be hundres of new elements. We don't want to pass multiple selected events or we'll do the repeated processing, slowing down our update
This commit is contained in:
parent
7962ab07e7
commit
f2ab07c8b4
|
@ -645,6 +645,7 @@ bool SCH_EDIT_FRAME::AddSheetAndUpdateDisplay( const wxString aFullFileName )
|
||||||
SyncView();
|
SyncView();
|
||||||
OnModify();
|
OnModify();
|
||||||
HardRedraw(); // Full reinit of the current screen and the display.
|
HardRedraw(); // Full reinit of the current screen and the display.
|
||||||
|
bool selected = false;
|
||||||
|
|
||||||
// Select all new items
|
// Select all new items
|
||||||
for( EDA_ITEM* item : GetScreen()->Items() )
|
for( EDA_ITEM* item : GetScreen()->Items() )
|
||||||
|
@ -652,7 +653,8 @@ bool SCH_EDIT_FRAME::AddSheetAndUpdateDisplay( const wxString aFullFileName )
|
||||||
if( !item->HasFlag( SKIP_STRUCT ) )
|
if( !item->HasFlag( SKIP_STRUCT ) )
|
||||||
{
|
{
|
||||||
commit.Added( item, GetScreen() );
|
commit.Added( item, GetScreen() );
|
||||||
selectionTool->AddItemToSel( item );
|
selectionTool->AddItemToSel( item, true );
|
||||||
|
selected = true;
|
||||||
|
|
||||||
if( item->Type() == SCH_LINE_T )
|
if( item->Type() == SCH_LINE_T )
|
||||||
item->SetFlags( STARTPOINT | ENDPOINT );
|
item->SetFlags( STARTPOINT | ENDPOINT );
|
||||||
|
@ -661,6 +663,9 @@ bool SCH_EDIT_FRAME::AddSheetAndUpdateDisplay( const wxString aFullFileName )
|
||||||
item->ClearFlags( SKIP_STRUCT );
|
item->ClearFlags( SKIP_STRUCT );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( selected )
|
||||||
|
m_toolManager->ProcessEvent( EVENTS::SelectedEvent );
|
||||||
|
|
||||||
// Start moving selection, cancel undoes the insertion
|
// Start moving selection, cancel undoes the insertion
|
||||||
if( !m_toolManager->RunSynchronousAction( EE_ACTIONS::move, &commit ) )
|
if( !m_toolManager->RunSynchronousAction( EE_ACTIONS::move, &commit ) )
|
||||||
commit.Revert();
|
commit.Revert();
|
||||||
|
|
Loading…
Reference in New Issue