From 611d9e3af343b662bedcdca367c96099b4007a82 Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Fri, 15 Jul 2011 13:00:40 +0200 Subject: [PATCH] Item#hitTest: ignore top level layers when hit testing for bounds or center. --- src/item/Item.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/item/Item.js b/src/item/Item.js index 7bbff83f..938bc79a 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -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(),