two.js
two.js copied to clipboard
wrong type in getPointAT declaration in path class
In types.d.t , the method getPointAT is declarated with 2 params t as boolean and obj as any, when t should be a number (float)
/**
* @name Two.Path#getPointAt
* @function
* @param {Boolean} t - Percentage value describing where on the {@link Two.Path} to estimate and assign coordinate values.
* @param {Two.Vector} [object] - Object to apply calculated x, y to. If none available returns new `Object`.
* @returns {Object}
* @description Given a float `t` from 0 to 1, return a point or assign a passed `obj`'s coordinates to that percentage on this {@link Two.Path}'s curve.
*/
getPointAt(t: boolean, obj: any): any;
==>
/**
* @name Two.Path#getPointAt
* @function
* @param {number} t - Percentage value describing where on the {@link Two.Path} to estimate and assign coordinate values.
* @param {Two.Vector} [object] - Object to apply calculated x, y to. If none available returns new `Object`.
* @returns {Object}
* @description Given a float `t` from 0 to 1, return a point or assign a passed `obj`'s coordinates to that percentage on this {@link Two.Path}'s curve.
*/
getPointAt(t: number, obj: any): any;
Congratulations on your great work!
Which version of Two.js are you using? The latest dev branch actually already has this fixed.
This PR improves it a bit too. Thanks for sharing: https://github.com/jonobr1/two.js/pull/694