Apply interpolation when restoring an animation-curve

+ Notify timeline when inserting a keyframe

Change-Id: I91548c4e45306e9a6c6490cc94b88080de3910ac
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Knud Dollereder
2019-08-27 14:02:48 +02:00
parent 1d319876c8
commit d17840ba92
9 changed files with 70 additions and 14 deletions

View File

@@ -31,6 +31,8 @@
#include <QLineF>
#include <QPainterPath>
#include <sstream>
namespace DesignTools {
AnimationCurve::AnimationCurve()
@@ -127,6 +129,21 @@ double AnimationCurve::maximumValue() const
return m_maxY;
}
std::string AnimationCurve::string() const
{
std::stringstream sstream;
sstream << "{ ";
for (size_t i = 0; i < m_frames.size(); ++i) {
if (i == m_frames.size() - 1)
sstream << m_frames[i].string();
else
sstream << m_frames[i].string() << ", ";
}
sstream << " }";
return sstream.str();
}
CurveSegment AnimationCurve::segment(double time) const
{
CurveSegment seg;