prevent a crash when clearBackground then undo then redo then clearBackground

preferencesAboutTextFull
Clément Fauconnier 2 years ago
parent 7e83f910ca
commit e33fc007c7
  1. 6
      src/domain/UBGraphicsItemUndoCommand.cpp
  2. 1
      src/domain/UBGraphicsScene.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);

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

Loading…
Cancel
Save