From 8d8b80f3c1511b37f030d897ad97b92993a03ca2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 2 Jul 2018 14:43:02 +0300 Subject: [PATCH] Require the first keyframe of an animation to be at zero offset Having empty space at the start of an animation produces unexpected results. --- source/animation.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/animation.cpp b/source/animation.cpp index b58a4ea7..02a2d371 100644 --- a/source/animation.cpp +++ b/source/animation.cpp @@ -61,6 +61,8 @@ void Animation::add_keyframe(const Time::TimeDelta &t, const KeyFrame &kf, float void Animation::add_keyframe(const Time::TimeDelta &t, const RefPtr &kf, float ss, float es) { + if(keyframes.empty() && t!=Time::zero) + throw invalid_argument("Animation::add_keyframe"); if(!keyframes.empty() && t