diff --git a/eeschema/sch_commit.cpp b/eeschema/sch_commit.cpp index 009448eeea..a1d1e01e50 100644 --- a/eeschema/sch_commit.cpp +++ b/eeschema/sch_commit.cpp @@ -73,8 +73,14 @@ COMMIT& SCH_COMMIT::Stage( EDA_ITEM *aItem, CHANGE_TYPE aChangeType, BASE_SCREEN // If aItem belongs a symbol, the full symbol will be saved because undo/redo does // not handle "sub items" modifications. - if( aItem->GetParent() && aItem->GetParent()->IsType( { SCH_SYMBOL_T, LIB_SYMBOL_T, - SCH_SHEET_T } ) ) + if( aItem->GetParent() && aItem->GetParent()->IsType( { SCH_SYMBOL_T, LIB_SYMBOL_T } ) ) + { + aItem->SetFlags( IS_MODIFIED_CHILD ); + aItem = aItem->GetParent(); + aChangeType = CHT_MODIFY; + } + // Same for fields of a sheet or label + else if( aItem->Type() == SCH_FIELD_T && aItem->GetParent() ) { aItem->SetFlags( IS_MODIFIED_CHILD ); aItem = aItem->GetParent(); @@ -237,7 +243,7 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags ) if( !( changeFlags & CHT_DONE ) ) { - if( !schItem->GetParent() ) + if( !screen->CheckIfOnDrawList( schItem ) ) // don't want a loop! screen->Append( schItem ); if( view ) diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index ecba87e45b..24f084c222 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -1898,13 +1898,14 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) || isSyntheticClick || evt->IsAction( &EE_ACTIONS::finishSheet ) ) ) { - m_view->ClearPreview(); getViewControls()->SetAutoPan( false ); getViewControls()->CaptureCursor( false ); if( m_frame->EditSheetProperties( static_cast( sheet ), &m_frame->GetCurrentSheet(), nullptr ) ) { + m_view->ClearPreview(); + sheet->AutoplaceFields( /* aScreen */ nullptr, /* aManual */ false ); SCH_COMMIT commit( m_toolMgr ); @@ -1916,6 +1917,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) } else { + m_view->ClearPreview(); delete sheet; }