mirror of
https://github.com/konvajs/konva.git
synced 2025-11-24 16:53:06 +08:00
fix #767
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -182,6 +182,30 @@ suite('Node', function() {
|
||||
|
||||
});
|
||||
|
||||
// ======================================================
|
||||
test('has shadow', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Kinetic.Layer();
|
||||
var rect = new Kinetic.Rect({
|
||||
x: 10,
|
||||
y: stage.getHeight() / 3,
|
||||
width: 100,
|
||||
height: 100,
|
||||
fill : "red",
|
||||
stroke: 'black',
|
||||
strokeWidth: 4,
|
||||
draggable: true
|
||||
});
|
||||
layer.add(rect);
|
||||
stage.add(layer);
|
||||
rect.shadowEnabled(true);
|
||||
rect.shadowColor("grey");
|
||||
assert.equal(rect.hasShadow(), true);
|
||||
rect.shadowEnabled(false);
|
||||
assert.equal(rect.hasShadow(), false);
|
||||
|
||||
});
|
||||
|
||||
// ======================================================
|
||||
test('opacity cache', function() {
|
||||
var stage = addStage();
|
||||
|
||||
Reference in New Issue
Block a user