Copy the background layer as background when a document is duplicated

This commit is contained in:
David Capello 2014-08-09 12:45:04 -03:00
parent 7632e83046
commit 8dff8a979d

View File

@ -403,7 +403,12 @@ Document* Document::duplicate(DuplicateType type) const
case DuplicateExactCopy: case DuplicateExactCopy:
// Copy the layer folder // Copy the layer folder
copyLayerContent(sprite()->folder(), documentCopy, spriteCopy->folder()); copyLayerContent(sourceSprite->folder(), documentCopy, spriteCopy->folder());
if (sourceSprite->backgroundLayer() != NULL) {
ASSERT(spriteCopy->folder()->getFirstLayer());
static_cast<LayerImage*>(spriteCopy->folder()->getFirstLayer())->configureAsBackground();
}
break; break;
case DuplicateWithFlattenLayers: case DuplicateWithFlattenLayers: