Implement test for strokeBounds of closed path with only one segment.

This commit is contained in:
Jürg Lehni 2013-12-07 16:16:26 +01:00
parent 054356c78d
commit 8f20dabf4d

View file

@ -78,10 +78,19 @@ test('path.strokeBounds on path with single segment and stroke color', function(
var path = new Path([ var path = new Path([
new Segment(new Point(121, 334), new Point(-19, 38), new Point(30.7666015625, -61.53369140625)) new Segment(new Point(121, 334), new Point(-19, 38), new Point(30.7666015625, -61.53369140625))
]); ]);
path.style.strokeColor = 'black'; path.strokeColor = 'black';
compareRectangles(path.strokeBounds, { x: 121, y: 334, width: 0, height: 0 }); compareRectangles(path.strokeBounds, { x: 121, y: 334, width: 0, height: 0 });
}); });
test('path.strokeBounds on closed path with single segment and stroke color', function() {
var path = new Path([
new Segment(new Point(121, 334), new Point(19, 38), new Point(30.7666015625, -61.53369140625))
]);
path.strokeColor = 'black';
path.closed = true;
compareRectangles(path.strokeBounds, { x: 120.5, y: 312.88324 , width: 19.91643, height: 30.53977 });
});
test('path.bounds & path.strokeBounds with stroke styles', function() { test('path.bounds & path.strokeBounds with stroke styles', function() {
function makePath() { function makePath() {
var path = new Path(); var path = new Path();