Fix part adding

This commit is contained in:
Jon Evans 2020-05-19 13:24:57 -04:00
parent 28b8e75211
commit 4e2e280bf4
3 changed files with 4 additions and 0 deletions

View File

@ -420,6 +420,7 @@ void SCH_EDIT_FRAME::CreateScreens()
m_schematic->SetRoot( new SCH_SHEET( m_schematic ) );
SCH_SCREEN* rootScreen = new SCH_SCREEN( &Kiway() );
rootScreen->SetParent( m_schematic );
rootScreen->SetMaxUndoItems( m_UndoRedoCountMax );
m_schematic->Root().SetScreen( rootScreen );
SetScreen( Schematic().RootScreen() );

View File

@ -445,6 +445,8 @@ int LIB_CONTROL::AddSymbolToSchematic( const TOOL_EVENT& aEvent )
SCH_COMPONENT* comp =
new SCH_COMPONENT( *part, libId, &schframe->GetCurrentSheet(), unit, convert );
comp->SetParent( schframe->GetCurrentSheet().LastScreen() );
if( schframe->eeconfig()->m_AutoplaceFields.enable )
comp->AutoplaceFields( /* aScreen */ nullptr, /* aManual */ false );

View File

@ -176,6 +176,7 @@ int SCH_DRAWING_TOOLS::PlaceComponent( const TOOL_EVENT& aEvent )
component = new SCH_COMPONENT(
*part, &m_frame->GetCurrentSheet(), sel, (wxPoint) cursorPos );
component->SetParent( m_frame->GetCurrentSheet().LastScreen() );
component->SetFlags( IS_NEW | IS_MOVED );
if( m_frame->eeconfig()->m_AutoplaceFields.enable )