diff --git a/.gitignore b/.gitignore index 1356683f5ff..eb188e73b42 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /npm-debug.log before_commit /coverage/ +.idea/ diff --git a/src/brushes/pencil_brush.class.js b/src/brushes/pencil_brush.class.js index 3662b84ca99..18d7bd6a4a2 100644 --- a/src/brushes/pencil_brush.class.js +++ b/src/brushes/pencil_brush.class.js @@ -134,8 +134,6 @@ /** * Converts points to SVG path * @param {Array} points Array of points - * @param {Number} minX - * @param {Number} minY * @return {String} SVG path */ convertPointsToSVGPath: function(points) { diff --git a/src/canvas.class.js b/src/canvas.class.js index f595a267881..fd1c8d6d24a 100644 --- a/src/canvas.class.js +++ b/src/canvas.class.js @@ -284,7 +284,6 @@ /** * Renders both the top canvas and the secondary container canvas. - * @param {Boolean} [allOnTop] Whether we want to force all images to be rendered on the top canvas * @return {fabric.Canvas} instance * @chainable */ @@ -320,7 +319,6 @@ /** * Resets the current transform to its original values and chooses the type of resizing based on the event * @private - * @param {Event} e Event object fired on mousemove */ _resetCurrentTransform: function() { var t = this._currentTransform; @@ -1108,6 +1106,7 @@ /** * Returns pointer coordinates relative to canvas. * @param {Event} e + * @param {Boolean} ignoreZoom * @return {Object} object with "x" and "y" number values */ getPointer: function (e, ignoreZoom, upperCanvasEl) { @@ -1327,6 +1326,7 @@ /** * Sets active group to a specified one * @param {fabric.Group} group Group to set as a current one + * @param {Event} e Event object * @return {fabric.Canvas} thisArg * @chainable */ diff --git a/src/gradient.class.js b/src/gradient.class.js index 972850f98fe..e7619877e41 100644 --- a/src/gradient.class.js +++ b/src/gradient.class.js @@ -162,7 +162,6 @@ /** * Returns SVG representation of an gradient * @param {Object} object Object to create a gradient for - * @param {Boolean} normalize Whether coords should be normalized * @return {String} SVG representation of an gradient (linear/radial) */ toSVG: function(object) { @@ -239,6 +238,7 @@ /** * Returns an instance of CanvasGradient * @param {CanvasRenderingContext2D} ctx Context to render on + * @param {Object} object * @return {CanvasGradient} */ toLive: function(ctx, object) { diff --git a/src/log.js b/src/log.js index 7fbe88785ac..694f73d751a 100644 --- a/src/log.js +++ b/src/log.js @@ -1,12 +1,12 @@ /** * Wrapper around `console.log` (when available) - * @param {Any} [values] Values to log + * @param {*} [values] Values to log */ fabric.log = function() { }; /** * Wrapper around `console.warn` (when available) - * @param {Any} [values] Values to log as a warning + * @param {*} [values] Values to log as a warning */ fabric.warn = function() { }; diff --git a/src/shapes/circle.class.js b/src/shapes/circle.class.js index 3363cc03b19..d2b89f66bdf 100644 --- a/src/shapes/circle.class.js +++ b/src/shapes/circle.class.js @@ -65,7 +65,7 @@ /** * @private * @param {String} key - * @param {Any} value + * @param {*} value * @return {fabric.Circle} thisArg */ _set: function(key, value) { diff --git a/src/shapes/itext.class.js b/src/shapes/itext.class.js index 7f15fc7f51f..dc8dae70199 100644 --- a/src/shapes/itext.class.js +++ b/src/shapes/itext.class.js @@ -585,6 +585,11 @@ * @private * @param {String} method * @param {CanvasRenderingContext2D} ctx Context to render on + * @param {Number} line + * @param {Number} left + * @param {Number} top + * @param {Number} lineIndex + * @param {Number} charOffset */ _renderChars: function(method, ctx, line, left, top, lineIndex, charOffset) { @@ -744,6 +749,9 @@ * @param {String} method * @param {CanvasRenderingContext2D} ctx Context to render on * @param {String} line + * @param {Number} left + * @param {Number} top + * @param {Number} lineIndex */ _renderTextLine: function(method, ctx, line, left, top, lineIndex) { // to "cancel" this.fontSize subtraction in fabric.Text#_renderTextLine @@ -990,6 +998,8 @@ /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on + * @param {Number} lineIndex + * @param {Number} charIndex */ _getHeightOfChar: function(ctx, lineIndex, charIndex) { var style = this._getStyleDeclaration(lineIndex, charIndex); diff --git a/src/shapes/line.class.js b/src/shapes/line.class.js index 96be50209f4..4786742f5f6 100644 --- a/src/shapes/line.class.js +++ b/src/shapes/line.class.js @@ -100,7 +100,7 @@ /** * @private * @param {String} key - * @param {Any} value + * @param {*} value */ _set: function(key, value) { this.callSuper('_set', key, value); diff --git a/src/shapes/object.class.js b/src/shapes/object.class.js index 2dedf43770b..158911c7be7 100644 --- a/src/shapes/object.class.js +++ b/src/shapes/object.class.js @@ -945,7 +945,7 @@ /** * Basic getter * @param {String} property Property name - * @return {Any} value of a property + * @return {*} value of a property */ get: function(property) { return this[property]; @@ -999,7 +999,7 @@ /** * @private * @param {String} key - * @param {Any} value + * @param {*} value * @return {fabric.Object} thisArg */ _set: function(key, value) { diff --git a/src/shapes/polyline.class.js b/src/shapes/polyline.class.js index 1f6e9a98c65..5602a5410f4 100644 --- a/src/shapes/polyline.class.js +++ b/src/shapes/polyline.class.js @@ -49,7 +49,6 @@ * Constructor * @param {Array} points Array of points (where each point is an object with x and y) * @param {Object} [options] Options object - * @param {Boolean} [skipOffset] Whether points offsetting should be skipped * @return {fabric.Polyline} thisArg * @example * var poly = new fabric.Polyline([ diff --git a/src/shapes/text.class.js b/src/shapes/text.class.js index 1c5b9e86e55..a1b6f77f8cd 100644 --- a/src/shapes/text.class.js +++ b/src/shapes/text.class.js @@ -411,7 +411,6 @@ /** * @private - * @param {CanvasRenderingContext2D} ctx Context to render on * @return {Number} Height of fabric.Text object */ _getTextHeight: function() { @@ -642,7 +641,6 @@ /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on - * @param {Array} textLines Array of all text lines */ _renderTextBackground: function(ctx) { this._renderTextBoxBackground(ctx); @@ -1094,7 +1092,7 @@ * we work around it by "moving" alpha channel into opacity attribute and setting fill's alpha to 1 * * @private - * @param {Any} value + * @param {*} value * @return {String} */ _getFillAttributes: function(value) { @@ -1109,7 +1107,7 @@ /** * Sets specified property to a specified value * @param {String} key - * @param {Any} value + * @param {*} value * @return {fabric.Text} thisArg * @chainable */ diff --git a/src/shapes/textbox.class.js b/src/shapes/textbox.class.js index fb7de902baa..fc60a58b901 100644 --- a/src/shapes/textbox.class.js +++ b/src/shapes/textbox.class.js @@ -338,7 +338,7 @@ * the same font-size value would result in different actual size depending * on the value of the scale. * @param {String} key - * @param {Any} value + * @param {*} value */ setOnGroup: function(key, value) { if (key === 'scaleX') { diff --git a/src/util/lang_array.js b/src/util/lang_array.js index 72a7ab71bcc..9e0e252694f 100644 --- a/src/util/lang_array.js +++ b/src/util/lang_array.js @@ -8,7 +8,6 @@ /** * Finds index of an element in an array * @param {Any} searchElement - * @param {Number} [fromIndex] * @return {Number} */ Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { @@ -135,7 +134,6 @@ /** * Returns "folded" (reduced) result of iterating over elements in an array * @param {Function} fn Callback to invoke for each element - * @param {Object} [initial] Object to use as the first argument to the first call of the callback * @return {Any} */ Array.prototype.reduce = function(fn /*, initial*/) { diff --git a/src/util/misc.js b/src/util/misc.js index 521e977f452..097f1cdfd6a 100644 --- a/src/util/misc.js +++ b/src/util/misc.js @@ -17,7 +17,7 @@ * @static * @memberOf fabric.util * @param {Array} array - * @param {Any} value + * @param {*} value * @return {Array} original array */ removeFromArray: function(array, value) { @@ -255,7 +255,7 @@ * @memberOf fabric.util * @param {String} url URL representing an image * @param {Function} callback Callback; invoked with loaded image - * @param {Any} [context] Context to invoke callback in + * @param {*} [context] Context to invoke callback in * @param {Object} [crossOrigin] crossOrigin value to set image element to */ loadImage: function(url, callback, context, crossOrigin) {