Make sure preview group gets added to view after a clear.
This commit is contained in:
parent
bd14f8a82a
commit
57c3d8e8d8
|
@ -1562,6 +1562,13 @@ void VIEW::ClearPreview()
|
|||
}
|
||||
|
||||
|
||||
void VIEW::InitPreview()
|
||||
{
|
||||
m_preview.reset( new KIGFX::VIEW_GROUP() );
|
||||
Add( m_preview.get() );
|
||||
}
|
||||
|
||||
|
||||
void VIEW::AddToPreview( EDA_ITEM* aItem, bool aTakeOwnership )
|
||||
{
|
||||
Hide( aItem, false );
|
||||
|
|
|
@ -112,10 +112,9 @@ void SCH_VIEW::DisplaySheet( SCH_SCREEN *aScreen )
|
|||
|
||||
ResizeSheetWorkingArea( aScreen );
|
||||
|
||||
m_preview.reset( new KIGFX::VIEW_GROUP() );
|
||||
|
||||
Add( m_worksheet.get() );
|
||||
Add( m_preview.get() );
|
||||
|
||||
InitPreview();
|
||||
}
|
||||
|
||||
|
||||
|
@ -171,8 +170,7 @@ void SCH_VIEW::DisplayComponent( LIB_PART* aPart )
|
|||
Add( &item );
|
||||
}
|
||||
|
||||
m_preview.reset( new KIGFX::VIEW_GROUP() );
|
||||
Add( m_preview.get() );
|
||||
InitPreview();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -663,6 +663,8 @@ public:
|
|||
|
||||
std::shared_ptr<VIEW_OVERLAY> MakeOverlay();
|
||||
|
||||
void InitPreview();
|
||||
|
||||
void ClearPreview();
|
||||
void AddToPreview( EDA_ITEM* aItem, bool aTakeOwnership = true );
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ void PCB_BASE_EDIT_FRAME::SetBoard( BOARD* aBoard )
|
|||
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||
|
||||
GetCanvas()->GetView()->Clear();
|
||||
GetCanvas()->GetView()->InitPreview();
|
||||
}
|
||||
|
||||
PCB_BASE_FRAME::SetBoard( aBoard );
|
||||
|
|
|
@ -1422,6 +1422,9 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
|
|||
controls()->SetAutoPan( true );
|
||||
frame()->UndoRedoBlock( true );
|
||||
|
||||
view()->ClearPreview();
|
||||
view()->InitPreview();
|
||||
|
||||
while( TOOL_EVENT* evt = Wait() )
|
||||
{
|
||||
frame()->GetCanvas()->SetCurrentCursor( wxCURSOR_ARROW );
|
||||
|
@ -1456,20 +1459,17 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
|
|||
previewItem->Move( offset );
|
||||
}
|
||||
|
||||
view()->Add( previewItem );
|
||||
view()->AddToPreview( previewItem );
|
||||
view()->Hide( drawing, true );
|
||||
}
|
||||
|
||||
previewItem = static_cast<BOARD_ITEM*>( module->Reference().Clone() );
|
||||
previewItem->Move( offset );
|
||||
view()->Add( previewItem );
|
||||
view()->AddToPreview( previewItem );
|
||||
view()->Hide( &module->Reference() );
|
||||
|
||||
previewItem = static_cast<BOARD_ITEM*>( module->Value().Clone() );
|
||||
previewItem->Move( offset );
|
||||
view()->Add( previewItem );
|
||||
view()->AddToPreview( previewItem );
|
||||
view()->Hide( &module->Value() );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue