mirror of
https://github.com/konvajs/konva.git
synced 2025-09-21 04:27:56 +08:00
Shape.hasShadow cache fix
Typo was causing hasShadow cache not to be invalidated after using setShadowEnabled. Fixes issue #693
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
// call super constructor
|
// call super constructor
|
||||||
Kinetic.Node.call(this, config);
|
Kinetic.Node.call(this, config);
|
||||||
|
|
||||||
this.on('shadowColorChange.kinetic shadowBlurChange.kinetic shadowOffsetChange.kinetic shadowOpacityChange.kinetic shadowEnabledChanged.kinetic', _clearHasShadowCache);
|
this.on('shadowColorChange.kinetic shadowBlurChange.kinetic shadowOffsetChange.kinetic shadowOpacityChange.kinetic shadowEnabledChange.kinetic', _clearHasShadowCache);
|
||||||
},
|
},
|
||||||
hasChildren: function() {
|
hasChildren: function() {
|
||||||
return false;
|
return false;
|
||||||
|
@@ -131,6 +131,10 @@ suite('Shape', function() {
|
|||||||
shape.setShadowOpacity(0.5);
|
shape.setShadowOpacity(0.5);
|
||||||
|
|
||||||
assert.equal(shape.hasShadow(), true, 'shape should have a shadow because opacity is nonzero');
|
assert.equal(shape.hasShadow(), true, 'shape should have a shadow because opacity is nonzero');
|
||||||
|
|
||||||
|
shape.setShadowEnabled(false);
|
||||||
|
|
||||||
|
assert.equal(shape.hasShadow(), false, 'shape should not have a shadow because it is not enabled');
|
||||||
});
|
});
|
||||||
|
|
||||||
// ======================================================
|
// ======================================================
|
||||||
|
Reference in New Issue
Block a user