Skip to content

Commit

Permalink
Merge pull request #1 from kangax/master
Browse files Browse the repository at this point in the history
JSdoc update (#3179)
  • Loading branch information
neopheus authored Aug 20, 2016
2 parents 3938c83 + 9b38362 commit c3e301b
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/npm-debug.log
before_commit
/coverage/
.idea/
2 changes: 0 additions & 2 deletions src/brushes/pencil_brush.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/canvas.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/gradient.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/log.js
Original file line number Diff line number Diff line change
@@ -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() { };

Expand Down
2 changes: 1 addition & 1 deletion src/shapes/circle.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
/**
* @private
* @param {String} key
* @param {Any} value
* @param {*} value
* @return {fabric.Circle} thisArg
*/
_set: function(key, value) {
Expand Down
10 changes: 10 additions & 0 deletions src/shapes/itext.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/shapes/line.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
/**
* @private
* @param {String} key
* @param {Any} value
* @param {*} value
*/
_set: function(key, value) {
this.callSuper('_set', key, value);
Expand Down
4 changes: 2 additions & 2 deletions src/shapes/object.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -999,7 +999,7 @@
/**
* @private
* @param {String} key
* @param {Any} value
* @param {*} value
* @return {fabric.Object} thisArg
*/
_set: function(key, value) {
Expand Down
1 change: 0 additions & 1 deletion src/shapes/polyline.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
6 changes: 2 additions & 4 deletions src/shapes/text.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@

/**
* @private
* @param {CanvasRenderingContext2D} ctx Context to render on
* @return {Number} Height of fabric.Text object
*/
_getTextHeight: function() {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand All @@ -1109,7 +1107,7 @@
/**
* Sets specified property to a specified value
* @param {String} key
* @param {Any} value
* @param {*} value
* @return {fabric.Text} thisArg
* @chainable
*/
Expand Down
2 changes: 1 addition & 1 deletion src/shapes/textbox.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
2 changes: 0 additions & 2 deletions src/util/lang_array.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */ ) {
Expand Down Expand Up @@ -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*/) {
Expand Down
4 changes: 2 additions & 2 deletions src/util/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @static
* @memberOf fabric.util
* @param {Array} array
* @param {Any} value
* @param {*} value
* @return {Array} original array
*/
removeFromArray: function(array, value) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c3e301b

Please sign in to comment.