diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2017-10-04 15:52:52 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-10-05 10:08:44 +0000 |
commit | a1150ccfe40be968aae7b745569bfefd7396e8c3 (patch) | |
tree | 6514bf5eb503f18c5ef48b0e03357f7f1b6da54c | |
parent | 054ecec467076dbe4e82db27dbc66a5876d1b199 (diff) |
Improve debug output for fcurves
Change-Id: I4a9044933b182a2e0eba745483f1b8bc214dcdba
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r-- | src/animation/backend/fcurve_p.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/animation/backend/fcurve_p.h b/src/animation/backend/fcurve_p.h index 7ab1593d1..e9138d6a1 100644 --- a/src/animation/backend/fcurve_p.h +++ b/src/animation/backend/fcurve_p.h @@ -98,14 +98,27 @@ private: inline QDebug operator<<(QDebug dbg, const FCurve &fcurve) { QDebugStateSaver saver(dbg); - dbg << "Keyframe Count =" << fcurve.keyframeCount() << endl; + dbg << "Keyframe Count = " << fcurve.keyframeCount() << endl; for (int i = 0; i < fcurve.keyframeCount(); ++i) { const Keyframe &kf = fcurve.keyframe(i); - dbg << "t =" << fcurve.localTime(i) - << "value =" << kf.value - << "leftHandle =" << kf.leftControlPoint - << "rightHandle =" << kf.rightControlPoint - << endl; + switch (kf.interpolation) { + case QKeyFrame::BezierInterpolation: { + dbg << "t = " << fcurve.localTime(i) + << ", value = " << kf.value + << ", leftHandle = " << kf.leftControlPoint + << ", rightHandle = " << kf.rightControlPoint + << endl; + break; + } + + case QKeyFrame::ConstantInterpolation: + case QKeyFrame::LinearInterpolation: { + dbg << "t = " << fcurve.localTime(i) + << ", value = " << kf.value + << endl; + break; + } + } } return dbg; } |