mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Add failing test of issue with Group#addChildren as reported in #119
This commit is contained in:
parent
6b08d96c45
commit
9604e2bd4f
1 changed files with 18 additions and 0 deletions
|
@ -52,4 +52,22 @@ test('Group bounds', function() {
|
||||||
group.rotate(20, new Point(50, 50));
|
group.rotate(20, new Point(50, 50));
|
||||||
compareRectangles(group.bounds, { x: 39.70692, y: 114.99196, width: 170.00412, height: 180.22401 }, 'rotated group.bounds');
|
compareRectangles(group.bounds, { x: 39.70692, y: 114.99196, width: 170.00412, height: 180.22401 }, 'rotated group.bounds');
|
||||||
compareRectangles(group.strokeBounds, { x: 37.20692, y: 112.49196, width: 175.00412, height: 185.22401 }, 'rotated group.strokeBounds');
|
compareRectangles(group.strokeBounds, { x: 37.20692, y: 112.49196, width: 175.00412, height: 185.22401 }, 'rotated group.strokeBounds');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('group.addChildren(otherGroup.children)', function() {
|
||||||
|
var group = new Group();
|
||||||
|
group.addChild(new Path());
|
||||||
|
group.addChild(new Path());
|
||||||
|
equals(function() {
|
||||||
|
return group.children.length;
|
||||||
|
}, 2);
|
||||||
|
|
||||||
|
var secondGroup = new Group();
|
||||||
|
secondGroup.addChildren(group.children);
|
||||||
|
equals(function() {
|
||||||
|
return secondGroup.children.length;
|
||||||
|
}, 2);
|
||||||
|
equals(function() {
|
||||||
|
return group.children.length;
|
||||||
|
}, 0);
|
||||||
});
|
});
|
Loading…
Reference in a new issue