Skip to content

Commit

Permalink
docs(): fix typo, fix JSDOC for website, minors (#7853)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 committed Apr 3, 2022
1 parent 6b64132 commit 1b99e62
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ async function runIntreactiveTestSuite(options) {
}, { unit: [], visual: [] });
_.reduce(tests, async (queue, files, suite) => {
await queue;
console.log(chalk.bold(chalk.blue(`running ${suite} test suite`)));
if (files.length > 0) {
console.log(chalk.bold(chalk.blue(`running ${suite} test suite`)));
return test(files, options);
}
}, Promise.resolve());
Expand Down
38 changes: 21 additions & 17 deletions src/util/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,11 @@
clone = fabric.util.object.clone;

/**
*
* @typedef {Object} AnimationOptions
* Animation of a value or list of values.
* When using lists, think of something like this:
* fabric.util.animate({
* startValue: [1, 2, 3],
* endValue: [2, 4, 6],
* onChange: function([a, b, c]) {
* canvas.zoomToPoint({x: b, y: c}, a)
* canvas.renderAll()
* }
* });
* @example
* @property {Function} [onChange] Callback; invoked on every value change
* @property {Function} [onComplete] Callback; invoked when value change is completed
* @example
* // Note: startValue, endValue, and byValue must match the type
* var animationOptions = { startValue: 0, endValue: 1, byValue: 0.25 }
* var animationOptions = { startValue: [0, 1], endValue: [1, 2], byValue: [0.25, 0.25] }
* @property {number | number[]} [startValue=0] Starting value
* @property {number | number[]} [endValue=100] Ending value
* @property {number | number[]} [byValue=100] Value to modify the property by
Expand Down Expand Up @@ -138,10 +125,27 @@
* Changes value from one to another within certain period of time, invoking callbacks as value is being changed.
* @memberOf fabric.util
* @param {AnimationOptions} [options] Animation options
* When using lists, think of something like this:
* @example
* fabric.util.animate({
* startValue: [1, 2, 3],
* endValue: [2, 4, 6],
* onChange: function([x, y, zoom]) {
* canvas.zoomToPoint(new fabric.Point(x, y), zoom);
* canvas.requestRenderAll();
* }
* });
*
* @example
* // Note: startValue, endValue, and byValue must match the type
* fabric.util.animate({ startValue: 0, endValue: 1, byValue: 0.25 })
* fabric.util.animate({ startValue: [0, 1], endValue: [1, 2], byValue: [0.25, 0.25] })
* fabric.util.animate({
* startValue: 1,
* endValue: 0,
* onChange: function(v) {
* obj.set('opacity', v);
* canvas.requestRenderAll();
* }
* });
*
* @returns {CancelFunction} cancel function
*/
function animate(options) {
Expand Down
2 changes: 1 addition & 1 deletion src/util/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@
* this is equivalent to remove from that object that transformation, so that
* added in a space with the removed transform, the object will be the same as before.
* Removing from an object a transform that scale by 2 is like scaling it by 1/2.
* Removing from an object a transfrom that rotate by 30deg is like rotating by 30deg
* Removing from an object a transform that rotate by 30deg is like rotating by 30deg
* in the opposite direction.
* This util is used to add objects inside transformed groups or nested groups.
* @memberOf fabric.util
Expand Down

0 comments on commit 1b99e62

Please sign in to comment.