From 4748bb48e8083ff76e6e4011d8452e8d1b0ff840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 4 Jul 2011 20:13:33 +0200 Subject: [PATCH] Fix and improve test for bounds of symbols with groups. --- test/tests/PlacedSymbol.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/tests/PlacedSymbol.js b/test/tests/PlacedSymbol.js index 24f6575e..39e86b16 100644 --- a/test/tests/PlacedSymbol.js +++ b/test/tests/PlacedSymbol.js @@ -60,12 +60,21 @@ test('bounds of group of symbol instances', function() { test('bounds of a symbol that contains a group of items', function() { var path = new Path.Circle(new Point(), 10); var path2 = path.clone(); - path2.position += [20, 0]; + path2.position.x += 20; + compareRectangles(path.bounds, + { x: -10, y: -10, width: 20, height: 20 }, + 'path bounds'); + compareRectangles(path2.bounds, + { x: 10, y: -10, width: 20, height: 20 }, + 'path2 bounds'); var group = new Group(path, path2); + compareRectangles(group.bounds, + { x: -10, y: -10, width: 40, height: 20 }, + 'Group bounds'); var symbol = new Symbol(group); - var instance = symbol.place(new Point(0, 0)); + var instance = symbol.place(new Point(50, 50)); compareRectangles(instance.bounds, - { x: -20, y: -10, width: 40, height: 20 }, + { x: 30, y: 40, width: 40, height: 20 }, 'Instance bounds'); });