mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Merge pull request #911 from sapics/hit-stroke
Add stroke hit-test option for shape items
This commit is contained in:
commit
8f0a2f37a0
2 changed files with 3 additions and 3 deletions
|
@ -1696,8 +1696,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
|
||||||
* and its sub-classes: {@values Group, Layer, Path, CompoundPath,
|
* and its sub-classes: {@values Group, Layer, Path, CompoundPath,
|
||||||
* Shape, Raster, PlacedSymbol, PointText, ...}
|
* Shape, Raster, PlacedSymbol, PointText, ...}
|
||||||
* @option options.fill {Boolean} hit-test the fill of items
|
* @option options.fill {Boolean} hit-test the fill of items
|
||||||
* @option options.stroke {Boolean} hit-test the stroke of path items,
|
* @option options.stroke {Boolean} hit-test the stroke of path and shape
|
||||||
* taking into account the setting of stroke color and width
|
* items, taking into account the setting of stroke color and width
|
||||||
* @option options.segments {Boolean} hit-test for {@link Segment#point} of
|
* @option options.segments {Boolean} hit-test for {@link Segment#point} of
|
||||||
* {@link Path} items
|
* {@link Path} items
|
||||||
* @option options.curves {Boolean} hit-test the curves of path items,
|
* @option options.curves {Boolean} hit-test the curves of path items,
|
||||||
|
|
|
@ -343,7 +343,7 @@ new function() { // Scope for _contains() and _hitTestSelf() code.
|
||||||
_hitTestSelf: function _hitTestSelf(point, options) {
|
_hitTestSelf: function _hitTestSelf(point, options) {
|
||||||
var hit = false,
|
var hit = false,
|
||||||
style = this._style;
|
style = this._style;
|
||||||
if (style.hasStroke()) {
|
if (options.stroke && style.hasStroke()) {
|
||||||
var type = this._type,
|
var type = this._type,
|
||||||
radius = this._radius,
|
radius = this._radius,
|
||||||
strokeWidth = style.getStrokeWidth(),
|
strokeWidth = style.getStrokeWidth(),
|
||||||
|
|
Loading…
Reference in a new issue