From 7f8d9d9e90d9e1b815bbd77b31e229ead27795f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 29 Oct 2013 19:17:42 +0100 Subject: [PATCH] Support options.tolerance in Shape#hitTest() --- src/item/Shape.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/item/Shape.js b/src/item/Shape.js index 22d70f32..bc7afc4f 100644 --- a/src/item/Shape.js +++ b/src/item/Shape.js @@ -225,10 +225,11 @@ var Shape = Item.extend(/** @lends Shape# */{ } }, - _hitTest: function _hitTest(point) { + _hitTest: function _hitTest(point, options) { if (this.hasStroke()) { var shape = this._shape, - strokeWidth = this.getStrokeWidth(); + strokeWidth = this.getStrokeWidth() + + 2 * (options.tolerance || 0); switch (shape) { case 'rectangle': var rect = new Rectangle(this._size).setCenter(0, 0),