mirror of
https://github.com/konvajs/konva.git
synced 2025-09-18 09:50:05 +08:00
updated docs
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
* @param {Number} [config.fillRadialGradientEndRadius]
|
||||
* @param {Array} [config.fillRadialGradientColorStops] array of color stops
|
||||
* @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
|
||||
* @param {String} [config.fillPriority] can be color, linear-gradient, radial-graident, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
|
||||
* @param {String} [config.stroke] stroke color
|
||||
* @param {Number} [config.strokeWidth] stroke width
|
||||
* @param {Boolean} [config.strokeEnabled] flag which enables or disables the stroke. The default value is true
|
||||
|
24
src/Shape.js
24
src/Shape.js
@@ -102,27 +102,51 @@
|
||||
var p = hitCanvas.context.getImageData(Math.round(pos.x), Math.round(pos.y), 1, 1).data;
|
||||
return p[3] > 0;
|
||||
},
|
||||
/**
|
||||
* enable fill
|
||||
*/
|
||||
enableFill: function() {
|
||||
this.setAttr('fillEnabled', true);
|
||||
},
|
||||
/**
|
||||
* disable fill
|
||||
*/
|
||||
disableFill: function() {
|
||||
this.setAttr('fillEnabled', false);
|
||||
},
|
||||
/**
|
||||
* enable stroke
|
||||
*/
|
||||
enableStroke: function() {
|
||||
this.setAttr('strokeEnabled', true);
|
||||
},
|
||||
/**
|
||||
* disable stroke
|
||||
*/
|
||||
disableStroke: function() {
|
||||
this.setAttr('strokeEnabled', false);
|
||||
},
|
||||
/**
|
||||
* enable shadow
|
||||
*/
|
||||
enableShadow: function() {
|
||||
this.setAttr('shadowEnabled', true);
|
||||
},
|
||||
/**
|
||||
* disable shadow
|
||||
*/
|
||||
disableShadow: function() {
|
||||
this.setAttr('shadowEnabled', false);
|
||||
},
|
||||
/**
|
||||
* enable dash array
|
||||
*/
|
||||
enableDashArray: function() {
|
||||
this.setAttr('dashArrayEnabled', true);
|
||||
},
|
||||
/**
|
||||
* disable dash array
|
||||
*/
|
||||
disableDashArray: function() {
|
||||
this.setAttr('dashArrayEnabled', false);
|
||||
},
|
||||
|
Reference in New Issue
Block a user