mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Improve unit tests for CompoundPath#contains()
This commit is contained in:
parent
ad4f74a872
commit
42ab9bbda7
1 changed files with 8 additions and 9 deletions
|
@ -112,23 +112,22 @@ test('CompoundPath#contains() (Donut)', function() {
|
|||
'The near bottom center point of the outer circle should be outside the donut.');
|
||||
testPoint(path, new Point({ length: 50, angle: 30 }), true,
|
||||
'A random point on the periphery of the outer circle should be inside the donut.');
|
||||
// False positive and negatives.
|
||||
// testPoint(path, new Point(0, 25), false,
|
||||
// 'The bottom center point of the inner circle should be outside the donut.');
|
||||
// testPoint(path, new Point({ length: 25, angle: 30 }), false,
|
||||
// 'A random point on the periphery of the inner circle should be outside the donut.');
|
||||
testPoint(path, new Point(-25, 0), true,
|
||||
'The left center point of the inner circle should be inside the donut.');
|
||||
testPoint(path, new Point(0, -25), true,
|
||||
'The top center point of the inner circle should be inside the donut.');
|
||||
testPoint(path, new Point(25, 0), true,
|
||||
'The right center point of the inner circle should be inside the donut.');
|
||||
testPoint(path, new Point(0, 25), true,
|
||||
'The bottom center point of the inner circle should be inside the donut.');
|
||||
testPoint(path, new Point({x: 21.654222720313882, y: 12.502112923650227}), true,
|
||||
'A random point on the periphery of the inner circle should be inside the donut.');
|
||||
testPoint(path, new Point(-50, -50), false,
|
||||
'The top left point of bounding box should be outside the donut.');
|
||||
testPoint(path, new Point(50, -50), false,
|
||||
'The top right point of the bounding box should be inside the donut.');
|
||||
'The top right point of the bounding box should be outside the donut.');
|
||||
testPoint(path, new Point(-50, 50), false,
|
||||
'The bottom left point of bounding box should be outside the donut.');
|
||||
testPoint(path, new Point(50, 50), false,
|
||||
'The bottom right point of the bounding box should be inside the donut.');
|
||||
'The bottom right point of the bounding box should be outside the donut.');
|
||||
testPoint(path, new Point(-45, 45), false,
|
||||
'The near bottom left point of bounding box should be outside the donut.');
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue