mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Add hitUnstrokedPaths option to hit tests
This commit is contained in:
parent
498097172d
commit
07d7f75bb4
2 changed files with 4 additions and 3 deletions
|
@ -1975,6 +1975,8 @@ new function() { // Injection scope for hit-test functions shared with project
|
|||
* @option options.selected {Boolean} only hit selected items
|
||||
* @option options.hitUnfilledPaths {Boolean} Allow hitting null or alpha 0
|
||||
* fills for paths
|
||||
* @option options.hitUnstrokedPaths {Boolean} Allow hitting null or alpha 0
|
||||
* strokes for paths
|
||||
*
|
||||
* @param {Point} point the point where the hit-test should be performed
|
||||
* (in global coordinates system).
|
||||
|
|
|
@ -1665,9 +1665,8 @@ var Path = PathItem.extend(/** @lends Path# */{
|
|||
strokePadding = tolerancePadding,
|
||||
join, cap, miterLimit,
|
||||
area, loc, res,
|
||||
hitStroke = options.stroke && style.hasStroke(),
|
||||
hitFill = options.hitUnfilledPaths
|
||||
? options.fill : options.fill && style.hasFill(),
|
||||
hitStroke = options.stroke && (style.hasStroke() || options.hitUnstrokedPaths),
|
||||
hitFill = options.fill && (style.hasFill() || options.hitUnfilledPaths),
|
||||
hitCurves = options.curves,
|
||||
strokeRadius = hitStroke
|
||||
? style.getStrokeWidth() / 2
|
||||
|
|
Loading…
Reference in a new issue