From eea4e533a4b124b6da4fee901e9c80e1e9ed6a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 10 Apr 2014 22:27:03 +0200 Subject: [PATCH] Support `type: Class` filters in hit-testing code too. --- src/item/Item.js | 2 +- src/path/CompoundPath.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/item/Item.js b/src/item/Item.js index a8ad9b25..7e210f86 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -1773,7 +1773,7 @@ var Item = Base.extend(Callback, /** @lends Item# */{ }, _getChildHitTestOptions: function(options) { - // This is overriden in CompoundPath, for treatment of type === 'path'. + // This is overridden in CompoundPath, for treatment of type === 'path'. return options; }, diff --git a/src/path/CompoundPath.js b/src/path/CompoundPath.js index 00dff421..cf88db32 100644 --- a/src/path/CompoundPath.js +++ b/src/path/CompoundPath.js @@ -236,9 +236,9 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{ }, /** @lends CompoundPath# */{ _getChildHitTestOptions: function(options) { // If we're not specifically asked to returns paths through - // options.type == 'path' do not test children for fill, since a - // compound path forms one shape. - return options.type === 'path' + // options.type == Path, do not test children for fill, since a + // compound path forms one shape. Also support legacy format 'path' + return options.type === Path || typeof type === 'path' ? options : new Base(options, { fill: false }); },