File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -765,10 +765,8 @@ class CanvasViewport : public Component
765765 // Returns a one-shot move animation so you can cascade it with another animation
766766 Animator const & getMoveAnimation (Point<float > const pos)
767767 {
768- static Animator moveAnimation = ValueAnimatorBuilder { }.build ();
769-
770- moveAnimation.complete ();
771- moveAnimation = ValueAnimatorBuilder { }
768+ moveChainAnimator.complete ();
769+ moveChainAnimator = ValueAnimatorBuilder { }
772770 .withEasing (Easings::createEaseInOutCubic ())
773771 .withDurationMs (300 )
774772 .withValueChangedCallback ([this ](float v) {
@@ -783,7 +781,7 @@ class CanvasViewport : public Component
783781 animationStartScale = animationTargetScale = getViewScale ();
784782 animationStartPos = getViewPosition ();
785783 animationEndPos = pos;
786- return moveAnimation ;
784+ return moveChainAnimator ;
787785 }
788786
789787 void setViewPosition (Point<float > newPos)
@@ -948,4 +946,6 @@ class CanvasViewport : public Component
948946 updateCanvasTransform ();
949947 })
950948 .build();
949+
950+ Animator moveChainAnimator = ValueAnimatorBuilder { }.build(); // Special animator used to chain move animations with other animations
951951};
You can’t perform that action at this time.
0 commit comments