Avoid assert() fail in configureAsBackground() call from NewSpriteFromSelectionCommand::onExecute()

This commit is contained in:
David Capello 2015-08-21 15:32:32 -03:00
parent 214f886a0e
commit 8cc3cf3eb8

View File

@ -73,9 +73,9 @@ void NewSpriteFromSelectionCommand::onExecute(Context* context)
palette->copyColorsTo(dstSprite->palette(frame_t(0)));
LayerImage* dstLayer = static_cast<LayerImage*>(dstSprite->folder()->getFirstLayer());
dstLayer->setFlags(site.layer()->flags()); // Copy all flags
if (site.layer()->isBackground())
dstLayer->configureAsBackground(); // Configure layer name as background
dstLayer->setFlags(site.layer()->flags()); // Copy all flags
copy_image(dstLayer->cel(frame_t(0))->image(), image.get());
base::UniquePtr<Document> dstDoc(new Document(dstSprite));