prevent a crash when clearBackground then undo then redo then clearBackground

preferencesAboutTextFull
Clément Fauconnier 3 years ago
parent 7e83f910ca
commit e33fc007c7
  1. 4
      src/domain/UBGraphicsItemUndoCommand.cpp
  2. 1
      src/domain/UBGraphicsScene.cpp

@ -246,6 +246,10 @@ void UBGraphicsItemUndoCommand::redo()
polygonItem->strokesGroup()->removeFromGroup(polygonItem); polygonItem->strokesGroup()->removeFromGroup(polygonItem);
} }
if (itemLayerType::BackgroundItem == item->data(UBGraphicsItemData::itemLayerType))
mScene->setAsBackgroundObject(nullptr);
else
mScene->removeItem(item); mScene->removeItem(item);
if (bApplyTransform) if (bApplyTransform)

@ -1476,6 +1476,7 @@ void UBGraphicsScene::clearContent(clearCase pCase)
if(mBackgroundObject){ if(mBackgroundObject){
removeItem(mBackgroundObject); removeItem(mBackgroundObject);
removedItems << mBackgroundObject; removedItems << mBackgroundObject;
mBackgroundObject = nullptr;
} }
break; break;

Loading…
Cancel
Save