mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Tests: add tests for group bounds after rotation.
This commit is contained in:
parent
506e7c036c
commit
f9ccd1d1a5
2 changed files with 6 additions and 2 deletions
|
@ -20,4 +20,8 @@ test('Group bounds', function() {
|
|||
var secondPath = new Path.Circle([175, 175], 85);
|
||||
var group = new Group([path, secondPath]);
|
||||
compareRectangles(group.bounds, { x: 90, y: 90, width: 170, height: 170 });
|
||||
group.rotate(20);
|
||||
compareRectangles(group.bounds, { x: 89.97681, y: 82.94095, width: 170.04639, height: 177.08224 });
|
||||
group.rotate(20, new Point(50, 50));
|
||||
compareRectangles(group.bounds, { x: 39.70692, y: 114.99196, width: 170.00412, height: 180.22401 });
|
||||
});
|
|
@ -15,10 +15,10 @@ test('placedSymbol bounds', function() {
|
|||
placedSymbol.scale(0.5);
|
||||
compareRectangles(placedSymbol.bounds,
|
||||
{ x: -25.5, y: -25.5, width: 51, height: 51 },
|
||||
'Bounds after scale');
|
||||
'Bounds after scale.');
|
||||
|
||||
placedSymbol.rotate(40);
|
||||
compareRectangles(placedSymbol.bounds,
|
||||
{ x: -25.50049, y: -25.50049, width: 51.00098, height: 51.00098 },
|
||||
'Bounds after rotation');
|
||||
'Bounds after rotation.');
|
||||
});
|
Loading…
Reference in a new issue