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

Docs / Types: Snap.animate with array of numbers #658

Open
Steditor opened this issue Aug 25, 2021 · 0 comments
Open

Docs / Types: Snap.animate with array of numbers #658

Steditor opened this issue Aug 25, 2021 · 0 comments

Comments

@Steditor
Copy link

The documentation claims that the setter of the Snap.animate function accepts one number argument:

- setter (function) caring function that accepts one number argument

However, if an array is provided for from and to, the setter will also receive an array:

Snap.svg/src/mina.js

Lines 104 to 113 in b365287

if (isArray(a.start)) {
res = [];
for (var j = 0, jj = a.start.length; j < jj; j++) {
res[j] = +a.start[j] +
(a.end[j] - a.start[j]) * a.easing(a.s);
}
} else {
res = +a.start + (a.end - a.start) * a.easing(a.s);
}
a.set(res);

This should be fixed in the documentation and afterwards then be applied to @types/snapsvg as well: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/snapsvg/index.d.ts#L41

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

No branches or pull requests

1 participant