mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
Add test for bounds of path item inside transformed group.
This commit is contained in:
parent
9ff39eb603
commit
41b2047a88
1 changed files with 8 additions and 0 deletions
|
@ -50,4 +50,12 @@ test('group.bounds when group contains empty group', function() {
|
||||||
compareRectangles(group.bounds, { x: 75, y: 75, width: 100, height: 100 }, 'group.bounds without empty group');
|
compareRectangles(group.bounds, { x: 75, y: 75, width: 100, height: 100 }, 'group.bounds without empty group');
|
||||||
group.addChild(new Group());
|
group.addChild(new Group());
|
||||||
compareRectangles(group.bounds, { x: 75, y: 75, width: 100, height: 100 }, 'group.bounds with empty group');
|
compareRectangles(group.bounds, { x: 75, y: 75, width: 100, height: 100 }, 'group.bounds with empty group');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('path.bounds when contained in a transformed group', function() {
|
||||||
|
var path = new Path([10, 10], [60, 60]);
|
||||||
|
var group = new Group([path]);
|
||||||
|
compareRectangles(path.bounds, { x: 10, y: 10, width: 50, height: 50 }, 'path.bounds before group translation');
|
||||||
|
group.translate(100, 100);
|
||||||
|
compareRectangles(path.bounds, { x: 110, y: 110, width: 50, height: 50 }, 'path.bounds after group translation');
|
||||||
});
|
});
|
Loading…
Reference in a new issue