mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Implement additional unit tests for path#getInteriorPoint()
This commit is contained in:
parent
e94e872cda
commit
a1666a9b82
1 changed files with 15 additions and 15 deletions
|
@ -296,19 +296,19 @@ test('CompoundPath#contains() (nested touching circles: #944)', function() {
|
|||
});
|
||||
|
||||
test('Path#contains() with Path#interiorPoint', function() {
|
||||
var path = new paper.Path({
|
||||
segments: [
|
||||
[100, 100],
|
||||
[150, 100],
|
||||
[150, 180],
|
||||
[200, 180],
|
||||
[200, 100],
|
||||
[250, 100],
|
||||
[250, 200],
|
||||
[100, 200]
|
||||
],
|
||||
closed: true
|
||||
});
|
||||
testPoint(path, path.interiorPoint, true,
|
||||
'The path\'s interior point should actually be inside the path');
|
||||
var paths = [
|
||||
'M100,100l50,0l0,80l50,0l0,-80l50,0l0,100l-150,0z',
|
||||
'M214.48881,363.27884c-0.0001,-0.00017 -0.0001,-0.00017 0,0z',
|
||||
'M289.92236,384.04631c0.00002,0.00023 0.00002,0.00023 0,0z',
|
||||
'M195.51448,280.25264c-0.00011,0.00013 -0.00011,0.00013 0,0z',
|
||||
'M514.7818,183.0217c-0.00011,-0.00026 -0.00011,-0.00026 0,0z',
|
||||
'M471.91288,478.44229c-0.00018,0.00022 -0.00018,0.00022 0,0z'
|
||||
];
|
||||
for (var i = 0; i < paths.length; i++) {
|
||||
var path = PathItem.create(paths[i]);
|
||||
testPoint(path, path.interiorPoint, true, 'The path[' + i +
|
||||
']\'s interior point should actually be inside the path');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue