Skip to content

Commit e2c7129

Browse files
authored
Merge pull request #669 from jackletter/patch-1
fix: when duration is negative, there should be no animation, no bad result, the tween should just finish immediately
2 parents d5ed238 + 0e87eaa commit e2c7129

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Tween.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ export class Tween<T extends UnknownProps> {
7676

7777
this._valuesEnd = target
7878
this._propertiesAreSetUp = false
79-
this._duration = duration
79+
this._duration = duration < 0 ? 0 : duration
8080

8181
return this
8282
}
8383

8484
duration(duration = 1000): this {
85-
this._duration = duration
85+
this._duration = duration < 0 ? 0 : duration
8686
return this
8787
}
8888

0 commit comments

Comments
 (0)