Skip to content

Commit

Permalink
Merge pull request #669 from jackletter/patch-1
Browse files Browse the repository at this point in the history
fix: when duration is negative, there should be no animation, no bad result, the tween should just finish immediately
  • Loading branch information
trusktr authored Jan 15, 2024
2 parents d5ed238 + 0e87eaa commit e2c7129
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Tween.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ export class Tween<T extends UnknownProps> {

this._valuesEnd = target
this._propertiesAreSetUp = false
this._duration = duration
this._duration = duration < 0 ? 0 : duration

return this
}

duration(duration = 1000): this {
this._duration = duration
this._duration = duration < 0 ? 0 : duration
return this
}

Expand Down

0 comments on commit e2c7129

Please sign in to comment.