mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Add an option to hit closed paths with transparent or alpha 0 fill
This commit is contained in:
parent
85633deb64
commit
4abc415002
2 changed files with 4 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue