Fix part adding
This commit is contained in:
parent
28b8e75211
commit
4e2e280bf4
|
@ -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() );
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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 )
|
||||
|
|
Loading…
Reference in New Issue