From 7c4ccb88417c23f53e0c24c4cb025b9d35b1da76 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 2 Jul 2018 14:44:23 +0300 Subject: [PATCH] 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. --- source/animation.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.45.2