mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Item#hitTest: ignore top level layers when hit testing for bounds or center.
This commit is contained in:
parent
91ab38ffd1
commit
611d9e3af3
1 changed files with 3 additions and 1 deletions
|
@ -691,7 +691,9 @@ var Item = this.Item = Base.extend(/** @lends Item# */{
|
|||
if (!this._children && !this.getRoughBounds(matrix)
|
||||
.expand(options.tolerance)._containsPoint(point))
|
||||
return null;
|
||||
if (options.center || options.bounds) {
|
||||
if ((options.center || options.bounds) &&
|
||||
// Ignore top level layers:
|
||||
!(this instanceof Layer && !this._parent)) {
|
||||
// Don't get the transformed bounds, check against transformed
|
||||
// points instead
|
||||
var bounds = this.getBounds(),
|
||||
|
|
Loading…
Reference in a new issue