Now that Path#strokeBounds produces correct results, the tests need fixing too.

This commit is contained in:
Jürg Lehni 2011-12-20 22:04:55 +01:00
parent 93ede28f3b
commit e59f076992
2 changed files with 8 additions and 8 deletions

View file

@ -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);

View file

@ -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() {