mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Add failing HitResult test.
This commit is contained in:
parent
d90be80fbe
commit
f7711fab57
1 changed files with 19 additions and 0 deletions
|
@ -262,6 +262,25 @@ test('hitting path handles (2)', function() {
|
|||
}
|
||||
});
|
||||
|
||||
test('hit testing stroke on segment point of a path', function() {
|
||||
var path = new Path([0, 0], [50, 50], [100, 0]);
|
||||
path.strokeColor = 'black';
|
||||
path.closed = true;
|
||||
|
||||
var error = null;
|
||||
try {
|
||||
var hitResult = paper.project.hitTest(path.firstSegment.point, {
|
||||
stroke: true
|
||||
});
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
var description = 'This hit test should not throw an error';
|
||||
if (error)
|
||||
description += ': ' + error;
|
||||
equals(error == null, true, description);
|
||||
});
|
||||
|
||||
test('hitting path ends', function() {
|
||||
var path = new Path([0, 0], [50, 50], [100, 0]);
|
||||
path.closed = true;
|
||||
|
|
Loading…
Reference in a new issue