mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
removeChildren now removes all descendants. returned this for all applicable methods in Node, Layer, Stage, and Shape
This commit is contained in:
@@ -317,6 +317,7 @@ Test.Modules.CONTAINER = {
|
||||
height: 200
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
var group = new Kinetic.Group();
|
||||
var circle1 = new Kinetic.Circle({
|
||||
x: 100,
|
||||
y: stage.getHeight() / 2,
|
||||
@@ -335,16 +336,19 @@ Test.Modules.CONTAINER = {
|
||||
strokeWidth: 4
|
||||
});
|
||||
|
||||
layer.add(circle1);
|
||||
layer.add(circle2);
|
||||
group.add(circle1);
|
||||
group.add(circle2);
|
||||
layer.add(group);
|
||||
stage.add(layer);
|
||||
|
||||
test(layer.children.length === 2, 'layer should have 2 children');
|
||||
test(layer.children.length === 1, 'layer should have 1 children');
|
||||
test(group.children.length === 2, 'group should have 2 children');
|
||||
|
||||
layer.removeChildren();
|
||||
layer.draw();
|
||||
|
||||
test(layer.children.length === 0, 'layer should have 0 children');
|
||||
test(group.children.length === 0, 'group should have 0 children');
|
||||
},
|
||||
'add group': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
@@ -1098,6 +1102,7 @@ Test.Modules.CONTAINER = {
|
||||
layer.add(bluecircle);
|
||||
stage.add(layer);
|
||||
|
||||
|
||||
test(layer.getZIndex() === 0, 'layer should have zindex of 0');
|
||||
|
||||
layer.moveDown();
|
||||
|
Reference in New Issue
Block a user