From f95d6ab310c0e02eafa214a668e58a99bb003c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 27 Dec 2015 13:33:49 +0100 Subject: [PATCH] Fix bug in Item#getItems(function() {}) Closes #751 --- src/item/Item.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/item/Item.js b/src/item/Item.js index 515caba5..5b7372c3 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -1963,12 +1963,13 @@ var Item = Base.extend(Emitter, /** @lends Item# */{ // method can be used for Project#layers as well in Project. _getItems: function _getItems(children, match, matrix, param, firstOnly) { - if (!param && typeof match === 'object') { + if (!param) { // Set up a couple of "side-car" values for the recursive calls // of _getItems below, mainly related to the handling of // inside / overlapping: - var overlapping = match.overlapping, - inside = match.inside, + var obj = typeof match === 'object' && match || {}, + overlapping = obj.overlapping, + inside = obj.inside, // If overlapping is set, we also perform the inside check: bounds = overlapping || inside, rect = bounds && Rectangle.read([bounds]);