File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,17 @@ export const renderFramesAt = (input: RenderInput): RenderOutput => {
7272 endKeyframe = currentFrames [ i ] ;
7373 }
7474
75+ // Return initial end points when past the end of the animation.
76+ const endKeyframeIsLast = endKeyframe === currentFrames [ currentFrames . length - 1 ] ;
77+ const animationIsPastEndKeyframe = endKeyframe . timestamp < input . timestamp ;
78+ if ( animationIsPastEndKeyframe && endKeyframeIsLast ) {
79+ return {
80+ renderCache,
81+ lastFrameId : endKeyframe . id ,
82+ points : endKeyframe . initialPoints ,
83+ } ;
84+ }
85+
7586 // Use and cache prepared points for current interpolation.
7687 let preparedStartPoints : Point [ ] | undefined =
7788 renderCache [ startKeyframe . id ] ?. preparedStartPoints ;
@@ -95,7 +106,7 @@ export const renderFramesAt = (input: RenderInput): RenderOutput => {
95106 ( input . timestamp - startKeyframe . timestamp ) /
96107 ( endKeyframe . timestamp - startKeyframe . timestamp ) ;
97108
98- // Keep progress withing expected range (ex. division by 0).
109+ // Keep progress within expected range (ex. division by 0).
99110 const clampedProgress = Math . max ( 0 , Math . min ( 1 , progress ) ) ;
100111
101112 // Apply timing function of end frame.
You can’t perform that action at this time.
0 commit comments