Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweening to arrays of values has bug #620

Closed
tvytlx opened this issue Aug 12, 2021 · 3 comments · Fixed by #621
Closed

tweening to arrays of values has bug #620

tvytlx opened this issue Aug 12, 2021 · 3 comments · Fixed by #621

Comments

@tvytlx
Copy link
Contributor

tvytlx commented Aug 12, 2021

_valuesEnd[property]'s length will grow endless, because it's a reference to this.valuesEnd

tween.js/src/Tween.ts

Lines 138 to 150 in 8db070d

if (isInterpolationList) {
let endValues = _valuesEnd[property] as Array<number | string>
if (endValues.length === 0) {
continue
}
// handle an array of relative values
endValues = endValues.map(this._handleRelativeValue.bind(this, startValue as number))
// Create a local copy of the Array with the start value at the front
_valuesEnd[property] = [startValue].concat(endValues)
}

checking this demo, just click the start button twice or more: https://jsbin.com/hulidowipa/edit?html,js,output

@tvytlx
Copy link
Contributor Author

tvytlx commented Aug 13, 2021

@trusktr hi, could you please check my pr? 🙏

@trusktr
Copy link
Member

trusktr commented Dec 2, 2021

Hello, sorry for the late reply. Thanks for looking at this!

The build in the PR has an error with Prettier. Would you mind adding a small unit test for this?

@trusktr
Copy link
Member

trusktr commented Apr 23, 2023

fixed in #621

@trusktr trusktr closed this as completed Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants