diff options
author | Knud Dollereder <knud.dollereder@qt.io> | 2020-03-16 16:43:58 +0100 |
---|---|---|
committer | Knud Dollereder <knud.dollereder@qt.io> | 2020-03-19 12:30:22 +0000 |
commit | 6cc080e055ed5c172367df0ce4c4be6eb812a471 (patch) | |
tree | 0b3e9855745173f6653dc81ee858c318ee65b783 /src/plugins/qmldesigner/components/timelineeditor | |
parent | db23f3e10b2ea294bb5b9f03ae5c6364dfdf5207 (diff) |
Make sure to neither load nor store invalid qeasing-curves
Remove set-value-spinbox.
Do not convert single-segment-qeasing-curves to bezier if they would become invalid.
Do not store invalid qeasing-curves in the keyframe ModelNode.
Make sure that a conversion does not produce nans
Change-Id: I0688de55bf6b0ef6fe69d70d9192d852c8d6b895
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/components/timelineeditor')
-rw-r--r-- | src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp | 3 | ||||
-rw-r--r-- | src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp b/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp index 35b89f6f17..023200f494 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp @@ -30,8 +30,8 @@ #include "qmltimeline.h" #include <bindingproperty.h> -#include <variantproperty.h> #include <theme.h> +#include <variantproperty.h> namespace QmlDesigner { @@ -204,6 +204,7 @@ std::vector<DesignTools::Keyframe> resolveSmallCurves( for (auto &&frame : frames) { if (frame.hasData() && !out.empty()) { QEasingCurve curve = frame.data().toEasingCurve(); + // One-segment-curve: Since (0,0) is implicit => 3 if (curve.toCubicSpline().count() == 3) { DesignTools::Keyframe &previous = out.back(); #if 0 diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp index d80749ad08..508db1051b 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp @@ -355,7 +355,8 @@ void TimelineWidget::updateAnimationCurve(DesignTools::PropertyTreeItem *item) if (previous.isValid()) { if (frame.interpolation() == DesignTools::Keyframe::Interpolation::Bezier) { DesignTools::CurveSegment segment(previous, frame); - attachEasingCurve(pos.x(), segment.easingCurve(), group); + if (segment.isValid()) + attachEasingCurve(pos.x(), segment.easingCurve(), group); } else if (frame.interpolation() == DesignTools::Keyframe::Interpolation::Easing) { QVariant data = frame.data(); |