Commit 089a28f9 authored by Agata Cacko's avatar Agata Cacko

Fix crash using onion skins on non-animated layers

Using onion skins on layers without any content keyframes
is possible if one is using opacity keyframes.
Before this commit, turning onion skins on would cause a crash.
After this commit, turning onion skins on will do nothing.

BUG:414668
parent b49d9789
......@@ -156,6 +156,11 @@ void KisOnionSkinCompositor::composite(const KisPaintDeviceSP sourceDevice, KisP
KisKeyframeSP keyframeFwd;
int time = sourceDevice->defaultBounds()->currentTime();
if (!keyframes) { // it happens when you try to show onion skins on non-animated layer with opacity keyframes
return;
}
keyframeBck = keyframeFwd = keyframes->activeKeyframeAt(time);
for (int offset = 1; offset <= m_d->numberOfSkins; offset++) {
......@@ -197,6 +202,11 @@ QRect KisOnionSkinCompositor::calculateExtent(const KisPaintDeviceSP device)
KisKeyframeSP keyframeFwd;
KisRasterKeyframeChannel *channel = device->keyframeChannel();
if (!channel) { // it happens when you try to show onion skins on non-animated layer with opacity keyframes
return rect;
}
keyframeBck = keyframeFwd = channel->activeKeyframeAt(device->defaultBounds()->currentTime());
for (int offset = 1; offset <= m_d->numberOfSkins; offset++) {
......
Markdown is supported
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