mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Now that Path#strokeBounds produces correct results, the tests need fixing too.
This commit is contained in:
parent
93ede28f3b
commit
e59f076992
2 changed files with 8 additions and 8 deletions
|
@ -136,7 +136,7 @@ test('path.bounds & path.strokeBounds with stroke styles', function() {
|
|||
{ x: 199.01325, y: 166.78419, width: 113.50622, height: 90.96766 },
|
||||
'square/round path.bounds');
|
||||
compareRectangles(path.strokeBounds,
|
||||
{ x: 178.06332, y: 150.9807, width: 149.45615, height: 121.77115 },
|
||||
{ x: 178.06332, y: 151.78419, width: 149.45615, height: 120.96766 },
|
||||
'square/strokeBounds path.bounds');
|
||||
|
||||
var path = makePath().translate(150, 150);
|
||||
|
@ -147,7 +147,7 @@ test('path.bounds & path.strokeBounds with stroke styles', function() {
|
|||
{ x: 349.01325, y: 166.78419, width: 113.50622, height: 90.96766 },
|
||||
'square/bevel path.bounds');
|
||||
compareRectangles(path.strokeBounds,
|
||||
{ x: 328.06332, y: 150.9807, width: 149.45615, height: 120.53383 },
|
||||
{ x: 328.06332, y: 151.78419, width: 149.45615, height: 119.73034 },
|
||||
'square/bevel path.strokeBounds');
|
||||
|
||||
var path = makePath().translate(300, 150);
|
||||
|
@ -158,7 +158,7 @@ test('path.bounds & path.strokeBounds with stroke styles', function() {
|
|||
{ x: 499.01325, y: 166.78419, width: 113.50622, height: 90.96766 },
|
||||
'square/miter path.bounds');
|
||||
compareRectangles(path.strokeBounds,
|
||||
{ x: 478.06332, y: 150.9807, width: 149.45615, height: 134.45231 },
|
||||
{ x: 478.06332, y: 151.78419, width: 149.45615, height: 133.64882 },
|
||||
'square/miter path.strokeBounds');
|
||||
|
||||
var path = makePath().translate(0, 300);
|
||||
|
|
|
@ -24,23 +24,23 @@ test('placedSymbol bounds', function() {
|
|||
path.strokeJoin = 'round';
|
||||
compareRectangles(path.strokeBounds,
|
||||
{ x: -0.5, y: -0.5, width: 101, height: 101 },
|
||||
'Path initial bounds.');
|
||||
'Path initial bounds');
|
||||
var symbol = new Symbol(path);
|
||||
var placedSymbol = new PlacedSymbol(symbol);
|
||||
|
||||
compareRectangles(placedSymbol.bounds,
|
||||
new Rectangle(-50.5, -50.5, 101, 101),
|
||||
'PlacedSymbol initial bounds.');
|
||||
'PlacedSymbol initial bounds');
|
||||
|
||||
placedSymbol.scale(1, 0.5);
|
||||
compareRectangles(placedSymbol.bounds,
|
||||
{ x: -50.5, y: -25.25, width: 101, height: 50.5 },
|
||||
'Bounds after scale.');
|
||||
'Bounds after scale');
|
||||
|
||||
placedSymbol.rotate(40);
|
||||
compareRectangles(placedSymbol.bounds,
|
||||
{ x: -42.04736, y: -37.91846, width: 84.09473, height: 75.83691 },
|
||||
'Bounds after rotation.');
|
||||
{ x: -41.96283, y: -37.79252, width: 83.92567, height: 75.58503 },
|
||||
'Bounds after rotation');
|
||||
});
|
||||
|
||||
test('bounds of group of symbol instances', function() {
|
||||
|
|
Loading…
Reference in a new issue