diff options
author | Knud Dollereder <knud.dollereder@qt.io> | 2020-03-17 16:41:34 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2020-03-19 09:45:48 +0000 |
commit | d72e18da2d1703ad56a0cfa30fedb70e97c73174 (patch) | |
tree | 5bd38f11169edfb688607164388df12583a83f3d /src/plugins/qmldesigner/components/timelineeditor | |
parent | 7675296fcf092c9f57f3c2887d397dcad02e1e69 (diff) |
Use QEasing instead of Bezier to paint the curve segments
This way "failure state" is reflected in the appearance of the curve item
Change-Id: I997f86f1a6072eaf65c77f2df0afd53a80dc0d0e
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 | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp b/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp index d37be1cd35..35b89f6f17 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp @@ -206,6 +206,13 @@ std::vector<DesignTools::Keyframe> resolveSmallCurves( QEasingCurve curve = frame.data().toEasingCurve(); if (curve.toCubicSpline().count() == 3) { DesignTools::Keyframe &previous = out.back(); +#if 0 + // Do not resolve when two adjacent keyframes have the same value. + if (qFuzzyCompare(previous.position().y(), frame.position().y())) { + out.push_back(frame); + continue; + } +#endif DesignTools::AnimationCurve acurve(curve, previous.position(), frame.position()); previous.setRightHandle(acurve.keyframeAt(0).rightHandle()); out.push_back(acurve.keyframeAt(1)); |