From: Mikko Rasa Date: Mon, 2 Jul 2018 11:43:02 +0000 (+0300) Subject: Require the first keyframe of an animation to be at zero offset X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=8d8b80f3c1511b37f030d897ad97b92993a03ca2 Require the first keyframe of an animation to be at zero offset Having empty space at the start of an animation produces unexpected results. --- 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