Fix bug where preview wasn't getting re-added after view cleared.

This commit is contained in:
Jeff Young 2020-08-04 20:40:40 +01:00
parent 3cf5db3ce5
commit 9cc6a77cc0
2 changed files with 10 additions and 3 deletions

View File

@ -104,7 +104,10 @@ void SCH_VIEW::DisplaySheet( SCH_SCREEN *aScreen )
ResizeSheetWorkingArea( aScreen ); ResizeSheetWorkingArea( aScreen );
m_preview.reset( new KIGFX::VIEW_GROUP() );
Add( m_worksheet.get() ); Add( m_worksheet.get() );
Add( m_preview.get() );
} }
@ -159,6 +162,9 @@ void SCH_VIEW::DisplayComponent( LIB_PART* aPart )
Add( &item ); Add( &item );
} }
m_preview.reset( new KIGFX::VIEW_GROUP() );
Add( m_preview.get() );
} }

View File

@ -62,9 +62,10 @@ void PCB_VIEW::Add( KIGFX::VIEW_ITEM* aItem, int aDrawPriority )
if( item->Type() == PCB_MODULE_T ) if( item->Type() == PCB_MODULE_T )
{ {
auto mod = static_cast<MODULE*>( item ); auto mod = static_cast<MODULE*>( item );
mod->RunOnChildren([this] ( BOARD_ITEM* aModItem ) { mod->RunOnChildren( [this] ( BOARD_ITEM* aModItem )
VIEW::Add( aModItem ); {
} ); VIEW::Add( aModItem );
} );
} }
VIEW::Add( item, aDrawPriority ); VIEW::Add( item, aDrawPriority );