Commit 7709ae20 authored by Emmet O'Neill's avatar Emmet O'Neill Committed by Agata Cacko
Browse files

Fixed animated transparency mask -> paint layer conversion.

Before, converting an animated transparency mask to a paint layer
would discard everything but the active frame. Now, each of the
animation keyframes is converted correctly.

BUG:419223
parent 42292bd5
......@@ -425,7 +425,6 @@ void KisLayerManager::convertNodeToPaintLayer(KisNodeSP source)
QRect rc(srcDevice->extent());
KisPainter::copyAreaOptimized(rc.topLeft(), srcDevice, clone, rc);
} else {
clone = new KisPaintDevice(*srcDevice);
}
......@@ -434,6 +433,17 @@ void KisLayerManager::convertNodeToPaintLayer(KisNodeSP source)
source->name(),
source->opacity(),
clone);
if (srcDevice->framesInterface()) {
KisKeyframeChannel *cloneKeyChannel = layer->getKeyframeChannel(KisKeyframeChannel::Content.id(), true);
layer->enableAnimation();
KisKeyframeChannel *sourceKeyChannel = srcDevice->keyframeChannel();
foreach (const int &index, sourceKeyChannel->allKeyframeIds()) {
cloneKeyChannel->copyExternalKeyframe(sourceKeyChannel, index, index);
}
}
layer->setCompositeOpId(newCompositeOp);
KisNodeSP parent = source->parent();
......@@ -452,7 +462,6 @@ void KisLayerManager::convertNodeToPaintLayer(KisNodeSP source)
m_commandsAdapter->removeNode(source);
m_commandsAdapter->addNode(layer, parent, above);
m_commandsAdapter->endMacro();
}
void KisLayerManager::convertGroupToAnimated()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment