mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Improve new hit-testing test.
This commit is contained in:
parent
3b782f6338
commit
f45fa853e7
1 changed files with 5 additions and 5 deletions
|
@ -541,7 +541,7 @@ test('Hit testing the corner of a rectangle with miter stroke.', function() {
|
||||||
}, true);
|
}, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Hit testing invisible items', function() {
|
test('Hit testing invisible items.', function() {
|
||||||
var point = new Point(0, 0);
|
var point = new Point(0, 0);
|
||||||
var circle1 = new Path.Circle({
|
var circle1 = new Path.Circle({
|
||||||
center: point.subtract([25, 0]),
|
center: point.subtract([25, 0]),
|
||||||
|
@ -555,14 +555,14 @@ test('Hit testing invisible items', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
equals(function() {
|
equals(function() {
|
||||||
return paper.project.hitTest(point).item;
|
return paper.project.hitTest(point).item === circle2;
|
||||||
}, circle2, 'circle2 should be returned.');
|
}, true);
|
||||||
|
|
||||||
circle2.visible = false;
|
circle2.visible = false;
|
||||||
|
|
||||||
equals(function() {
|
equals(function() {
|
||||||
return paper.project.hitTest(point).item;
|
return paper.project.hitTest(point).item === circle1;
|
||||||
}, circle1, 'circle1 should be returned.');
|
}, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: project.hitTest(point, {type: AnItemType});
|
// TODO: project.hitTest(point, {type: AnItemType});
|
Loading…
Reference in a new issue