mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
refactored Image event bindings and fixed radial gradient bug
This commit is contained in:
@@ -136,7 +136,7 @@ Kinetic.Shape.prototype = {
|
||||
context.fill();
|
||||
}
|
||||
// radial gradient
|
||||
else if(s.radius && e.radius) {
|
||||
else if((s.radius || s.radius === 0) && (e.radius || e.radius === 0)) {
|
||||
var context = this.getContext();
|
||||
var grd = context.createRadialGradient(s.x, s.y, s.radius, e.x, e.y, e.radius);
|
||||
var colorStops = fill.colorStops;
|
||||
|
@@ -14,18 +14,10 @@ Kinetic.Image = function(config) {
|
||||
Kinetic.Rect.apply(this, [config]);
|
||||
|
||||
// update attrs when one of the following changes
|
||||
this.on('widthChange', function() {
|
||||
this._setAttrs();
|
||||
});
|
||||
this.on('heightChange', function() {
|
||||
this._setAttrs();
|
||||
});
|
||||
this.on('imageChange', function() {
|
||||
this._setAttrs();
|
||||
});
|
||||
this.on('cropChange', function() {
|
||||
this._setAttrs();
|
||||
});
|
||||
this.on('widthChange', this._setAttrs);
|
||||
this.on('heightChange', this._setAttrs);
|
||||
this.on('imageChange', this._setAttrs);
|
||||
this.on('cropChange', this._setAttrs);
|
||||
|
||||
this._setAttrs();
|
||||
};
|
||||
|
Reference in New Issue
Block a user