From 336460b51f58117b25848a0beaefe2d1fdf1bb6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 3 Feb 2016 17:38:30 +0100 Subject: [PATCH] Define unit test for #internalBounds regression. --- test/tests/Item_Bounds.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/test/tests/Item_Bounds.js b/test/tests/Item_Bounds.js index 6c466338..7094e978 100644 --- a/test/tests/Item_Bounds.js +++ b/test/tests/Item_Bounds.js @@ -597,14 +597,29 @@ test('path.strokeBounds without strokeScaling and zoomed view', function() { strokeScaling: false }); - equals(path.strokeBounds, - new Rectangle(-103.75, -103.75, 207.5, 207.5), + equals(path.strokeBounds, new Rectangle(-103.75, -103.75, 207.5, 207.5), 'path.strokeBounds with zoomed view'); view.zoom = 1; - equals(path.strokeBounds, - new Rectangle(-107.5, -107.5, 215, 215), + equals(path.strokeBounds, new Rectangle(-107.5, -107.5, 215, 215), 'path.strokeBounds without zoomed view'); }); +test('path.internalBounds', function() { + // To test for a strange strokeBounds regression caused by commit + // 1ac8e46d55643f663e439d2cb5d05a40fc68d011 + + var path = new Path.Circle({ + center: [0, 0], + radius: 100 + }); + + equals(path.internalBounds, new Rectangle(-100, -100, 200, 200), + 'path.internalBounds'); + + path.rotate(45); + + equals(path.internalBounds, new Rectangle(-100, -100, 200, 200), + 'path.internalBounds'); +});