diff --git a/src/domain/UBGraphicsItemUndoCommand.cpp b/src/domain/UBGraphicsItemUndoCommand.cpp index 4787aed5..8ad68b22 100644 --- a/src/domain/UBGraphicsItemUndoCommand.cpp +++ b/src/domain/UBGraphicsItemUndoCommand.cpp @@ -246,7 +246,11 @@ void UBGraphicsItemUndoCommand::redo() polygonItem->strokesGroup()->removeFromGroup(polygonItem); } - mScene->removeItem(item); + + if (itemLayerType::BackgroundItem == item->data(UBGraphicsItemData::itemLayerType)) + mScene->setAsBackgroundObject(nullptr); + else + mScene->removeItem(item); if (bApplyTransform) item->setTransform(t); diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 0336a63c..533b97c1 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -1476,6 +1476,7 @@ void UBGraphicsScene::clearContent(clearCase pCase) if(mBackgroundObject){ removeItem(mBackgroundObject); removedItems << mBackgroundObject; + mBackgroundObject = nullptr; } break;