Add an option to hit closed paths with transparent or alpha 0 fill

This commit is contained in:
DD 2017-12-06 18:15:48 -05:00
parent 85633deb64
commit 4abc415002
2 changed files with 4 additions and 1 deletions

View file

@ -1894,6 +1894,8 @@ new function() { // Injection scope for hit-test functions shared with project
* @option options.guides {Boolean} hit-test items that have {@link
* Item#guide} set to `true`
* @option options.selected {Boolean} only hit selected items
* @option options.hitUnfilledPaths {Boolean} Allow hitting null or alpha 0
* fills for paths
*
* @param {Point} point the point where the hit-test should be performed
* @param {Object} [options={ fill: true, stroke: true, segments: true,

View file

@ -1660,7 +1660,8 @@ var Path = PathItem.extend(/** @lends Path# */{
join, cap, miterLimit,
area, loc, res,
hitStroke = options.stroke && style.hasStroke(),
hitFill = options.fill && style.hasFill(),
hitFill = options.hitUnfilledPaths
? options.fill : options.fill && style.hasFill(),
hitCurves = options.curves,
strokeRadius = hitStroke
? style.getStrokeWidth() / 2