Support options.tolerance in Shape#hitTest()

This commit is contained in:
Jürg Lehni 2013-10-29 19:17:42 +01:00
parent 156c7cfbc3
commit 7f8d9d9e90

View file

@ -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),