Skip to content

Commit

Permalink
Update code v2 (#3180)
Browse files Browse the repository at this point in the history
* update JSDOC - v4
* update JSDOC -v5
  • Loading branch information
neopheus authored and asturur committed Aug 20, 2016
1 parent 9b38362 commit 3544b72
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 8 deletions.
11 changes: 11 additions & 0 deletions src/filters/resize_filter.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
* Applies filter to canvas element
* @memberOf fabric.Image.filters.Resize.prototype
* @param {Object} canvasEl Canvas element to apply filter to
* @param {Number} scaleX
* @param {Number} scaleY
*/
applyTo: function(canvasEl, scaleX, scaleY) {

Expand Down Expand Up @@ -85,6 +87,15 @@
canvasEl.getContext('2d').putImageData(imageData, 0, 0);
},

/**
* Filter sliceByTwo
* @param {Object} canvasEl Canvas element to apply filter to
* @param {Number} width
* @param {Number} height
* @param {Number} newWidth
* @param {Number} newHeight
* @returns {ImageData}
*/
sliceByTwo: function(canvasEl, width, height, newWidth, newHeight) {
var context = canvasEl.getContext('2d'), imageData,
multW = 0.5, multH = 0.5, signW = 1, signH = 1,
Expand Down
2 changes: 1 addition & 1 deletion src/shapes/ellipse.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
/**
* @private
* @param {String} key
* @param {Any} value
* @param {*} value
* @return {fabric.Ellipse} thisArg
*/
_set: function(key, value) {
Expand Down
2 changes: 1 addition & 1 deletion src/shapes/group.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@
/**
* Returns requested property
* @param {String} prop Property to get
* @return {Any}
* @return {*}
*/
get: function(prop) {
if (prop in _lockProperties) {
Expand Down
4 changes: 4 additions & 0 deletions src/shapes/image.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@
* Applies filters assigned to this image (from "filters" array)
* @method applyFilters
* @param {Function} callback Callback is invoked when all filters have been applied and new image is generated
* @param {Array} filters to be initialized
* @param {fabric.Image} imgElement
* @param {Boolean} forResizing
* @return {fabric.Image} thisArg
* @chainable
*/
Expand Down Expand Up @@ -397,6 +400,7 @@
/**
* @private
* @param {CanvasRenderingContext2D} ctx Context to render on
* @param {Boolean} noTransform
*/
_render: function(ctx, noTransform) {
var x, y, imageMargins = this._findMargins(), elementToDraw;
Expand Down
2 changes: 1 addition & 1 deletion src/shapes/itext.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
* @private
* @param {String} method
* @param {CanvasRenderingContext2D} ctx Context to render on
* @param {Number} line
* @param {String} line Content of the line
* @param {Number} left
* @param {Number} top
* @param {Number} lineIndex
Expand Down
1 change: 1 addition & 0 deletions src/shapes/line.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
/**
* @private
* @param {CanvasRenderingContext2D} ctx Context to render on
* @param {Boolean} noTransform
*/
_render: function(ctx, noTransform) {
ctx.beginPath();
Expand Down
2 changes: 1 addition & 1 deletion src/shapes/path_group.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
/**
* Sets certain property to a certain value
* @param {String} prop
* @param {Any} value
* @param {*} value
* @return {fabric.PathGroup} thisArg
*/
_set: function(prop, value) {
Expand Down
2 changes: 2 additions & 0 deletions src/shapes/polygon.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
/**
* @private
* @param {CanvasRenderingContext2D} ctx Context to render on
* @param {Boolean} noTransform
*/
_render: function(ctx, noTransform) {
if (!this.commonRender(ctx, noTransform)) {
Expand All @@ -148,6 +149,7 @@
/**
* @private
* @param {CanvasRenderingContext2D} ctx Context to render on
* @param {Boolean} noTransform
*/
commonRender: function(ctx, noTransform) {
var point, len = this.points.length;
Expand Down
1 change: 1 addition & 0 deletions src/shapes/polyline.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
/**
* @private
* @param {CanvasRenderingContext2D} ctx Context to render on
* @param {Boolean} noTransform
*/
_render: function(ctx, noTransform) {
if (!fabric.Polygon.prototype.commonRender.call(this, ctx, noTransform)) {
Expand Down
1 change: 1 addition & 0 deletions src/shapes/rect.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
/**
* @private
* @param {CanvasRenderingContext2D} ctx Context to render on
* @param {Boolean} noTransform
*/
_render: function(ctx, noTransform) {

Expand Down
2 changes: 2 additions & 0 deletions src/shapes/text.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@
/**
* @private
* @param {CanvasRenderingContext2D} ctx Context to render on
* @param {String} method Method name ("fillText" or "strokeText")
*/
_renderTextCommon: function(ctx, method) {

Expand Down Expand Up @@ -858,6 +859,7 @@
/**
* Renders text instance on a specified context
* @param {CanvasRenderingContext2D} ctx Context to render on
* @param {Boolean} noTransform
*/
render: function(ctx, noTransform) {
// do not render if object is not visible
Expand Down
8 changes: 4 additions & 4 deletions src/util/lang_array.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
if (!Array.prototype.indexOf) {
/**
* Finds index of an element in an array
* @param {Any} searchElement
* @param {*} searchElement
* @return {Number}
*/
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
Expand Down Expand Up @@ -134,7 +134,7 @@
/**
* Returns "folded" (reduced) result of iterating over elements in an array
* @param {Function} fn Callback to invoke for each element
* @return {Any}
* @return {*}
*/
Array.prototype.reduce = function(fn /*, initial*/) {
var len = this.length >>> 0,
Expand Down Expand Up @@ -188,7 +188,7 @@
* @memberOf fabric.util.array
* @param {Array} array Array to iterate over
* @param {String} byProperty
* @return {Any}
* @return {*}
*/
function max(array, byProperty) {
return find(array, byProperty, function(value1, value2) {
Expand All @@ -201,7 +201,7 @@
* @memberOf fabric.util.array
* @param {Array} array Array to iterate over
* @param {String} byProperty
* @return {Any}
* @return {*}
*/
function min(array, byProperty) {
return find(array, byProperty, function(value1, value2) {
Expand Down
2 changes: 2 additions & 0 deletions src/util/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
* Converts from attribute value to pixel value if applicable.
* Returns converted pixels or original value not converted.
* @param {Number|String} value number to operate on
* @param {Number} fontSize
* @return {Number|String}
*/
parseUnit: function(value, fontSize) {
Expand Down Expand Up @@ -348,6 +349,7 @@
* @memberOf fabric.util
* @param {Array} elements SVG elements to group
* @param {Object} [options] Options object
* @param {String} path Value to set sourcePath to
* @return {fabric.Object|fabric.PathGroup}
*/
groupSVGElements: function(elements, options, path) {
Expand Down

0 comments on commit 3544b72

Please sign in to comment.