From: Mikko Rasa Date: Mon, 2 Jul 2018 11:44:23 +0000 (+0300) Subject: Don't link keyframes with zero interval X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=7c4ccb88417c23f53e0c24c4cb025b9d35b1da76;p=libs%2Fgl.git Don't link keyframes with zero interval Fixes an issue where a lone instant keyframe at the end of the animation would produce bad values as the iterator tries to divide by zero. --- diff --git a/source/animation.cpp b/source/animation.cpp index 1cfb533f..e82a92a8 100644 --- a/source/animation.cpp +++ b/source/animation.cpp @@ -78,9 +78,10 @@ void Animation::add_keyframe(const Time::TimeDelta &t, const RefPtr1) + if(keyframes.size()>1 && t>(&tkf-1)->time) tkf.prev = &tkf-1; prepare_keyframe(tkf);