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;