mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Support options.tolerance in Shape#hitTest()
This commit is contained in:
parent
156c7cfbc3
commit
7f8d9d9e90
1 changed files with 3 additions and 2 deletions
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue