From 9c4296eda06308aa1e911a998bf5ac63b922b3f1 Mon Sep 17 00:00:00 2001 From: sapics Date: Mon, 18 Jan 2016 10:04:53 +0900 Subject: [PATCH] Add stroke hit-test option for shape items --- src/item/Item.js | 4 ++-- src/item/Shape.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/item/Item.js b/src/item/Item.js index f0d8501f..2cd4b28f 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -1696,8 +1696,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{ * and its sub-classes: {@values Group, Layer, Path, CompoundPath, * Shape, Raster, PlacedSymbol, PointText, ...} * @option options.fill {Boolean} hit-test the fill of items - * @option options.stroke {Boolean} hit-test the stroke of path items, - * taking into account the setting of stroke color and width + * @option options.stroke {Boolean} hit-test the stroke of path and shape + * items, taking into account the setting of stroke color and width * @option options.segments {Boolean} hit-test for {@link Segment#point} of * {@link Path} items * @option options.curves {Boolean} hit-test the curves of path items, diff --git a/src/item/Shape.js b/src/item/Shape.js index 3a93a02a..e95d6a2c 100644 --- a/src/item/Shape.js +++ b/src/item/Shape.js @@ -343,7 +343,7 @@ new function() { // Scope for _contains() and _hitTestSelf() code. _hitTestSelf: function _hitTestSelf(point, options) { var hit = false, style = this._style; - if (style.hasStroke()) { + if (options.stroke && style.hasStroke()) { var type = this._type, radius = this._radius, strokeWidth = style.getStrokeWidth(),