From d777f760d56fa8d37ad512f86ea3f74d7ec7aa90 Mon Sep 17 00:00:00 2001 From: Daniel Wolf Date: Tue, 20 Dec 2016 22:33:47 +0100 Subject: [PATCH] When animating backward: Allow one non-conforming shape --- src/animation/roughAnimation.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/animation/roughAnimation.cpp b/src/animation/roughAnimation.cpp index a08abb7..918a019 100644 --- a/src/animation/roughAnimation.cpp +++ b/src/animation/roughAnimation.cpp @@ -39,13 +39,13 @@ JoiningContinuousTimeline animateRough(const ContinuousTimeline maxAnticipationDuration) break; - // Make sure the new, backwards-animated shape still resembles the anticipated shape - const Shape anticipatingShape = getClosestShape(referenceShape, std::get(reverseIt->getValue())); - if (getBasicShape(anticipatingShape) != getBasicShape(anticipatedShape)) break; - // Overwrite forward-animated shape with backwards-animated, anticipating shape + const Shape anticipatingShape = getClosestShape(referenceShape, std::get(reverseIt->getValue())); shapes.set(reverseIt->getTimeRange(), anticipatingShape); + // Make sure the new, backwards-animated shape still resembles the anticipated shape + if (getBasicShape(anticipatingShape) != getBasicShape(anticipatedShape)) break; + referenceShape = anticipatingShape; } lastAnticipatedShapeStart = anticipatedShapeStart;