mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
moved globalCompositeOperation
property to Konva.Node
This commit is contained in:
parent
f47c1328ce
commit
d3498fc0fa
@ -4,6 +4,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## [Not released][Not released]
|
## [Not released][Not released]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- moved `globalCompositeOperation` property to `Konva.Node`
|
||||||
|
|
||||||
## [1.6.0][2017-04-21]
|
## [1.6.0][2017-04-21]
|
||||||
|
|
||||||
|
42
konva.js
42
konva.js
@ -2653,6 +2653,7 @@
|
|||||||
_drawCachedSceneCanvas: function(context) {
|
_drawCachedSceneCanvas: function(context) {
|
||||||
context.save();
|
context.save();
|
||||||
context._applyOpacity(this);
|
context._applyOpacity(this);
|
||||||
|
context._applyGlobalCompositeOperation(this);
|
||||||
context.translate(this._cache.canvas.x, this._cache.canvas.y);
|
context.translate(this._cache.canvas.x, this._cache.canvas.y);
|
||||||
|
|
||||||
var cacheCanvas = this._getCachedSceneCanvas();
|
var cacheCanvas = this._getCachedSceneCanvas();
|
||||||
@ -4376,6 +4377,26 @@
|
|||||||
* node.y(5);
|
* node.y(5);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Konva.Factory.addGetterSetter(
|
||||||
|
Konva.Node,
|
||||||
|
'globalCompositeOperation',
|
||||||
|
'source-over'
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get/set globalCompositeOperation of a shape
|
||||||
|
* @name globalCompositeOperation
|
||||||
|
* @method
|
||||||
|
* @memberof Konva.Node.prototype
|
||||||
|
* @param {Number} blur
|
||||||
|
* @returns {Number}
|
||||||
|
* @example
|
||||||
|
* // get shadow blur
|
||||||
|
* var globalCompositeOperation = shape.globalCompositeOperation();
|
||||||
|
*
|
||||||
|
* // set shadow blur
|
||||||
|
* shape.globalCompositeOperation('source-in');
|
||||||
|
*/
|
||||||
Konva.Factory.addGetterSetter(Konva.Node, 'opacity', 1);
|
Konva.Factory.addGetterSetter(Konva.Node, 'opacity', 1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -8890,27 +8911,6 @@
|
|||||||
Konva.Validators.alphaComponent
|
Konva.Validators.alphaComponent
|
||||||
);
|
);
|
||||||
|
|
||||||
Konva.Factory.addGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'globalCompositeOperation',
|
|
||||||
'source-over'
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get/set globalCompositeOperation of a shape
|
|
||||||
* @name globalCompositeOperation
|
|
||||||
* @method
|
|
||||||
* @memberof Konva.Shape.prototype
|
|
||||||
* @param {Number} blur
|
|
||||||
* @returns {Number}
|
|
||||||
* @example
|
|
||||||
* // get shadow blur
|
|
||||||
* var globalCompositeOperation = shape.globalCompositeOperation();
|
|
||||||
*
|
|
||||||
* // set shadow blur
|
|
||||||
* shape.globalCompositeOperation('source-in');
|
|
||||||
*/
|
|
||||||
|
|
||||||
Konva.Factory.addGetterSetter(Konva.Shape, 'shadowBlur');
|
Konva.Factory.addGetterSetter(Konva.Shape, 'shadowBlur');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
10
konva.min.js
vendored
10
konva.min.js
vendored
File diff suppressed because one or more lines are too long
21
src/Node.js
21
src/Node.js
@ -317,6 +317,7 @@
|
|||||||
_drawCachedSceneCanvas: function(context) {
|
_drawCachedSceneCanvas: function(context) {
|
||||||
context.save();
|
context.save();
|
||||||
context._applyOpacity(this);
|
context._applyOpacity(this);
|
||||||
|
context._applyGlobalCompositeOperation(this);
|
||||||
context.translate(this._cache.canvas.x, this._cache.canvas.y);
|
context.translate(this._cache.canvas.x, this._cache.canvas.y);
|
||||||
|
|
||||||
var cacheCanvas = this._getCachedSceneCanvas();
|
var cacheCanvas = this._getCachedSceneCanvas();
|
||||||
@ -2040,6 +2041,26 @@
|
|||||||
* node.y(5);
|
* node.y(5);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Konva.Factory.addGetterSetter(
|
||||||
|
Konva.Node,
|
||||||
|
'globalCompositeOperation',
|
||||||
|
'source-over'
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get/set globalCompositeOperation of a shape
|
||||||
|
* @name globalCompositeOperation
|
||||||
|
* @method
|
||||||
|
* @memberof Konva.Node.prototype
|
||||||
|
* @param {Number} blur
|
||||||
|
* @returns {Number}
|
||||||
|
* @example
|
||||||
|
* // get shadow blur
|
||||||
|
* var globalCompositeOperation = shape.globalCompositeOperation();
|
||||||
|
*
|
||||||
|
* // set shadow blur
|
||||||
|
* shape.globalCompositeOperation('source-in');
|
||||||
|
*/
|
||||||
Konva.Factory.addGetterSetter(Konva.Node, 'opacity', 1);
|
Konva.Factory.addGetterSetter(Konva.Node, 'opacity', 1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
21
src/Shape.js
21
src/Shape.js
@ -786,27 +786,6 @@
|
|||||||
Konva.Validators.alphaComponent
|
Konva.Validators.alphaComponent
|
||||||
);
|
);
|
||||||
|
|
||||||
Konva.Factory.addGetterSetter(
|
|
||||||
Konva.Shape,
|
|
||||||
'globalCompositeOperation',
|
|
||||||
'source-over'
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get/set globalCompositeOperation of a shape
|
|
||||||
* @name globalCompositeOperation
|
|
||||||
* @method
|
|
||||||
* @memberof Konva.Shape.prototype
|
|
||||||
* @param {Number} blur
|
|
||||||
* @returns {Number}
|
|
||||||
* @example
|
|
||||||
* // get shadow blur
|
|
||||||
* var globalCompositeOperation = shape.globalCompositeOperation();
|
|
||||||
*
|
|
||||||
* // set shadow blur
|
|
||||||
* shape.globalCompositeOperation('source-in');
|
|
||||||
*/
|
|
||||||
|
|
||||||
Konva.Factory.addGetterSetter(Konva.Shape, 'shadowBlur');
|
Konva.Factory.addGetterSetter(Konva.Shape, 'shadowBlur');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user