mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +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:
parent
ee6a786ebb
commit
d92a5f53e5
@ -43,7 +43,7 @@
|
||||
// call super constructor
|
||||
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() {
|
||||
return false;
|
||||
|
@ -131,6 +131,10 @@ suite('Shape', function() {
|
||||
shape.setShadowOpacity(0.5);
|
||||
|
||||
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');
|
||||
});
|
||||
|
||||
// ======================================================
|
||||
|
Loading…
Reference in New Issue
Block a user