From ba092b316e3c552142d537c2bfe3bb903bf914b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 15 Jun 2015 19:01:21 +0200 Subject: [PATCH] Implement unit test for error behind issue #676 --- test/tests/Item_Bounds.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/tests/Item_Bounds.js b/test/tests/Item_Bounds.js index 7718a158..223190b4 100644 --- a/test/tests/Item_Bounds.js +++ b/test/tests/Item_Bounds.js @@ -59,6 +59,16 @@ test('group.bounds and position after children were modified', function() { equals(group.position, new Point(100, 100), 'group.position after change'); }); +test('group.bounds when containing empty path first', function() { + var group = new Group(); + var path = new Path(); + group.addChild(path); + equals(group.bounds, new Rectangle(0, 0, 0, 0), 'group.bounds with empty path'); + path.moveTo([75, 75]); + path.lineTo([175, 175]); + equals(group.bounds, new Rectangle(75, 75, 100, 100), 'group.bounds after adding segments to path'); +}); + test('path.bounds when contained in a transformed group', function() { var path = new Path([10, 10], [60, 60]); var group = new Group([path]);