Skip to content

Commit

Permalink
changes to jsdocs (fabricjs#5862)
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur authored Aug 31, 2019
1 parent f6e05c6 commit 6c5fa1d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
11 changes: 6 additions & 5 deletions src/gradient.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
* Imported from svg gradients, is not applied with the current transform in the center.
* Before this transform is applied, the origin point is at the top left corner of the object
* plus the addition of offsetY and offsetX.
* @type Array[Number]
* @type Number[]
* @default null
*/
gradientTransform: null,
Expand All @@ -110,14 +110,15 @@
* If `pixels`, the number of coords are in the same unit of width / height.
* If set as `percentage` the coords are still a number, but 1 means 100% of width
* for the X and 100% of the height for the y. It can be bigger than 1 and negative.
* @type String pixels || percentage
* allowed values pixels or percentage.
* @type String
* @default 'pixels'
*/
gradientUnits: 'pixels',

/**
* Gradient type
* @type String linear || radial
* Gradient type linear or radial
* @type String
* @default 'pixels'
*/
type: 'linear',
Expand All @@ -129,7 +130,7 @@
* @param {Object} [options.gradientUnits] gradient units
* @param {Object} [options.offsetX] SVG import compatibility
* @param {Object} [options.offsetY] SVG import compatibility
* @param {Array[Object]} options.colorStops contains the colorstops.
* @param {Object[]} options.colorStops contains the colorstops.
* @param {Object} options.coords contains the coords of the gradient
* @param {Number} [options.coords.x1] X coordiante of the first point for linear or of the focal point for radial
* @param {Number} [options.coords.y1] Y coordiante of the first point for linear or of the focal point for radial
Expand Down
3 changes: 2 additions & 1 deletion src/shapes/image.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,8 @@
},

/**
* @private, needed to check if image needs resize
* needed to check if image needs resize
* @private
*/
_needsResize: function() {
var scale = this.getTotalObjectScaling();
Expand Down
3 changes: 3 additions & 0 deletions src/shapes/object.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -1903,6 +1903,7 @@
* @param {Function} [callback] Callback to invoke when image set as a pattern
* @return {fabric.Object} thisArg
* @chainable
* @deprecated since 3.5.0
* @see {@link http://jsfiddle.net/fabricjs/QT3pa/|jsFiddle demo}
* @example <caption>Set pattern</caption>
* object.setPatternFill({
Expand All @@ -1923,6 +1924,7 @@
* @param {Number} [options.offsetY=0] Shadow vertical offset
* @return {fabric.Object} thisArg
* @chainable
* @deprecated since 3.5.0
* @see {@link http://jsfiddle.net/fabricjs/7gvJG/|jsFiddle demo}
* @example <caption>Set shadow with string notation</caption>
* object.setShadow('2px 2px 10px rgba(0,0,0,0.2)');
Expand All @@ -1944,6 +1946,7 @@
* Sets "color" of an instance (alias of `set('fill', &hellip;)`)
* @param {String} color Color value
* @return {fabric.Object} thisArg
* @deprecated since 3.5.0
* @chainable
*/
setColor: function(color) {
Expand Down
8 changes: 4 additions & 4 deletions src/util/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@
* @memberOf fabric.util
* @param {Object} options
* @param {Number} [options.angle] angle in degrees
* @return {Array[Number]} transform matrix
* @return {Number[]} transform matrix
*/
calcRotateMatrix: function(options) {
if (!options.angle) {
Expand All @@ -721,7 +721,7 @@
* @param {Boolean} [options.flipY]
* @param {Number} [options.skewX]
* @param {Number} [options.skewX]
* @return {Array[Number]} transform matrix
* @return {Number[]} transform matrix
*/
calcDimensionsMatrix: function(options) {
var scaleX = typeof options.scaleX === 'undefined' ? 1 : options.scaleX,
Expand Down Expand Up @@ -766,7 +766,7 @@
* @param {Number} [options.skewX]
* @param {Number} [options.translateX]
* @param {Number} [options.translateY]
* @return {Array[Number]} transform matrix
* @return {Number[]} transform matrix
*/
composeMatrix: function(options) {
var matrix = [1, 0, 0, 1, options.translateX || 0, options.translateY || 0],
Expand All @@ -789,7 +789,7 @@
* @param {Number} scaleX
* @param {Number} scaleY
* @param {Number} skewX
* @return {Array[Number]} transform matrix
* @return {Number[]} transform matrix
*/
customTransformMatrix: function(scaleX, scaleY, skewX) {
return fabric.util.composeMatrix({ scaleX: scaleX, scaleY: scaleY, skewX: skewX });
Expand Down

0 comments on commit 6c5fa1d

Please sign in to comment.