Skip to content

Commit

Permalink
Added callback in setPatternFill (fabricjs#5101)
Browse files Browse the repository at this point in the history
* Added callback in setPatternFill

As Pattern constructor taking callback, we can use it.

* doc changed fabricjs#4555

* jsdoc @link added in setCoords
  • Loading branch information
durga598 authored and asturur committed Jul 14, 2018
1 parent ab467b8 commit 7d96c67
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/mixins/object_geometry.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@
},

/**
* Sets corner position coordinates based on current angle, width and height
* See https://github.com/kangax/fabric.js/wiki/When-to-call-setCoords
* Sets corner position coordinates based on current angle, width and height.
* See {@link https://github.com/kangax/fabric.js/wiki/When-to-call-setCoords|When-to-call-setCoords}
* @param {Boolean} [ignoreZoom] set oCoords with or without the viewport transform.
* @param {Boolean} [skipAbsolute] skip calculation of aCoords, usefull in setViewportTransform
* @return {fabric.Object} thisArg
Expand Down
16 changes: 7 additions & 9 deletions src/shapes/object.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -1588,20 +1588,18 @@
* @param {String} [options.repeat=repeat] Repeat property of a pattern (one of repeat, repeat-x, repeat-y or no-repeat)
* @param {Number} [options.offsetX=0] Pattern horizontal offset from object's left/top corner
* @param {Number} [options.offsetY=0] Pattern vertical offset from object's left/top corner
* @param {Function} [callback] Callback to invoke when image set as a pattern
* @return {fabric.Object} thisArg
* @chainable
* @see {@link http://jsfiddle.net/fabricjs/QT3pa/|jsFiddle demo}
* @example <caption>Set pattern</caption>
* fabric.util.loadImage('http://fabricjs.com/assets/escheresque_ste.png', function(img) {
* object.setPatternFill({
* source: img,
* repeat: 'repeat'
* });
* canvas.renderAll();
* });
* object.setPatternFill({
* source: 'http://fabricjs.com/assets/escheresque_ste.png',
* repeat: 'repeat'
* },canvas.renderAll.bind(canvas));
*/
setPatternFill: function(options) {
return this.set('fill', new fabric.Pattern(options));
setPatternFill: function(options, callback) {
return this.set('fill', new fabric.Pattern(options, callback));
},

/**
Expand Down
6 changes: 3 additions & 3 deletions src/shapes/text.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,21 @@

/**
* Text decoration underline.
* @type String
* @type Boolean
* @default
*/
underline: false,

/**
* Text decoration overline.
* @type String
* @type Boolean
* @default
*/
overline: false,

/**
* Text decoration linethrough.
* @type String
* @type Boolean
* @default
*/
linethrough: false,
Expand Down

0 comments on commit 7d96c67

Please sign in to comment.