mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-23 20:55:47 +00:00
Added callback in setPatternFill (#5101)
* Added callback in setPatternFill As Pattern constructor taking callback, we can use it. * doc changed #4555 * jsdoc @link added in setCoords
This commit is contained in:
parent
efa490fff0
commit
a37e802ed7
3 changed files with 12 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue