Commit 0a80687f authored by Ryan Holtz's avatar Ryan Holtz
Browse files

Resolved Bug 436895 - "Rotoscoping not working right"

When building the QVariantMap for serialization into a QJsonDocument within KeyframeMdel::getRotoProperty, an incorrect padding width was being calculated for the QString keys. As a QVariantMap uses string ordering for its values, this resulted in Roto_spline keyframe data appearing out-of-order in saved data, as well as when being handed to MLT for previewing.

As adding 1 to the incoming value of log10() is ostensibly a no-op, and log10() returns 1 less than the number of digits in positive integers, the original author's intent was probably to add 1 to the result rather than the input. This results in all of the resulting JSON objects' names being padded equally, eliminating the ordering-related munging.

Additionally, any user previously affected by this needs only to re-save the relevant .kdenlive project file, and proper ordering will be restored.
parent 6bf17261
Pipeline #65219 passed with stage
in 8 minutes and 34 seconds
......@@ -737,7 +737,7 @@ QString KeyframeModel::getRotoProperty() const
int out = in + ptr->data(m_index, AssetParameterModel::ParentDurationRole).toInt();
QVariantMap map;
for (const auto &keyframe : m_keyframeList) {
map.insert(QString::number(keyframe.first.frames(pCore->getCurrentFps())).rightJustified(int(log10(double(out + 1))), '0'), keyframe.second.second);
map.insert(QString::number(keyframe.first.frames(pCore->getCurrentFps())).rightJustified(int(log10(double(out))) + 1, '0'), keyframe.second.second);
doc = QJsonDocument::fromVariant(map);
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