Skip to content

Commit

Permalink
Define unit test for #internalBounds regression.
Browse files Browse the repository at this point in the history
  • Loading branch information
lehni committed Feb 3, 2016
1 parent 41aca10 commit 336460b
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions test/tests/Item_Bounds.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

0 comments on commit 336460b

Please sign in to comment.