Support type: Class filters in hit-testing code too.

This commit is contained in:
Jürg Lehni 2014-04-10 22:27:03 +02:00
parent 61c2b11938
commit eea4e533a4
2 changed files with 4 additions and 4 deletions

View file

@ -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;
},

View file

@ -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 });
},