File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
packages/svelte/src/motion Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' svelte ' : patch
3+ ---
4+
5+ fix: make Tween work with continuous target changes
Original file line number Diff line number Diff line change @@ -230,7 +230,6 @@ export class Tween {
230230 set ( value , options ) {
231231 set ( this . #target, value ) ;
232232
233- let previous_value = this . #current. v ;
234233 let previous_task = this . #task;
235234
236235 let started = false ;
@@ -254,10 +253,12 @@ export class Tween {
254253 if ( ! started ) {
255254 started = true ;
256255
257- fn = interpolate ( /** @type {any } */ ( previous_value ) , value ) ;
256+ const prev = this . #current. v ;
257+
258+ fn = interpolate ( prev , value ) ;
258259
259260 if ( typeof duration === 'function' ) {
260- duration = duration ( /** @type { any } */ ( previous_value ) , value ) ;
261+ duration = duration ( prev , value ) ;
261262 }
262263
263264 previous_task ?. abort ( ) ;
You can’t perform that action at this time.
0 commit comments