Commit 66e96bc4 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix crash on misconfigured wipe composition.

BUG: 446203
parent 45116ac4
......@@ -122,11 +122,13 @@ bool CompositionModel::requestResize(int size, bool right, Fun &undo, Fun &redo,
// Slide composition uses a keyframe at end of composition, so update last keyframe
refresh = [this]() {
QString animation(m_asset->get("geometry"));
if (animation.contains(QLatin1Char(';')) && !animation.contains(QLatin1String(";-1="))) {
QString result = animation.section(QLatin1Char(';'), 0, 0);
result.append(QStringLiteral(";-1="));
result.append(animation.section(QLatin1Char('='), -1));
m_asset->set("geometry", result.toUtf8().constData());
if ((animation.contains(QLatin1Char(';')) && !animation.contains(QLatin1String(";-1="))) || animation.endsWith(QLatin1Char('='))) {
if (animation.contains(QLatin1String(" 0%;")) || animation.contains(QLatin1String(" 0;"))) {
// reverse anim
m_asset->set("geometry", "0=0% 0% 100% 100% 0%;-1=0% 0% 100% 100% 100%");
} else {
m_asset->set("geometry", "0=0% 0% 100% 100% 100%;-1=0% 0% 100% 100% 0%");
}
}
return true;
};
......
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