Shape.hasShadow cache fix

Typo was causing hasShadow cache not to be invalidated after using
setShadowEnabled. Fixes issue #693
This commit is contained in:
Guy Cook 2014-01-26 17:17:14 +13:00
parent ee6a786ebb
commit d92a5f53e5
2 changed files with 5 additions and 1 deletions

View File

@ -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;

View File

@ -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');
});
// ======================================================