Fix bug in Item#getItems(function() {})

Closes #751
This commit is contained in:
Jürg Lehni 2015-12-27 13:33:49 +01:00
parent 08d75a48ff
commit f95d6ab310

View file

@ -1963,12 +1963,13 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
// method can be used for Project#layers as well in Project. // method can be used for Project#layers as well in Project.
_getItems: function _getItems(children, match, matrix, param, _getItems: function _getItems(children, match, matrix, param,
firstOnly) { firstOnly) {
if (!param && typeof match === 'object') { if (!param) {
// Set up a couple of "side-car" values for the recursive calls // Set up a couple of "side-car" values for the recursive calls
// of _getItems below, mainly related to the handling of // of _getItems below, mainly related to the handling of
// inside / overlapping: // inside / overlapping:
var overlapping = match.overlapping, var obj = typeof match === 'object' && match || {},
inside = match.inside, overlapping = obj.overlapping,
inside = obj.inside,
// If overlapping is set, we also perform the inside check: // If overlapping is set, we also perform the inside check:
bounds = overlapping || inside, bounds = overlapping || inside,
rect = bounds && Rectangle.read([bounds]); rect = bounds && Rectangle.read([bounds]);