mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-29 07:09:45 -04:00
Implement a first version of Item#hitTest(), so far working only for Path items. Work in progress.
This commit is contained in:
parent
de87c1f97a
commit
69a7d0bfd4
7 changed files with 154 additions and 7 deletions
src/project
|
@ -181,6 +181,16 @@ var Project = this.Project = Base.extend(/** @lends Project# */{
|
|||
this._selectedItems[i].setSelected(false);
|
||||
},
|
||||
|
||||
hitTest: function(point, options) {
|
||||
options = HitResult.getOptions(options);
|
||||
for (var i = 0, l = this.layers.length; i < l; i++) {
|
||||
var res = this.layers[i].hitTest(point, options);
|
||||
if (res)
|
||||
return res;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* {@grouptitle Project Hierarchy}
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue