mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 06:00:56 -05:00
option.tolerance should always be defined in _hitTest()
This commit is contained in:
parent
ae4ddaeae5
commit
f8d960d834
3 changed files with 3 additions and 4 deletions
|
@ -1489,7 +1489,7 @@ var Item = Base.extend(Callback, /** @lends Item# */{
|
|||
// this item does not have children, since we'd have to travel up the
|
||||
// chain already to determine the rough bounds.
|
||||
if (!this._children && !this.getRoughBounds()
|
||||
.expand(options.tolerance)._containsPoint(point))
|
||||
.expand(2 * options.tolerance)._containsPoint(point))
|
||||
return null;
|
||||
// Transform point to local coordinates but use untransformed point
|
||||
// for bounds check above.
|
||||
|
|
|
@ -277,8 +277,7 @@ new function() { // Scope for _contains() and _hitTest() code.
|
|||
if (this.hasStroke()) {
|
||||
var shape = this._shape,
|
||||
radius = this._radius,
|
||||
strokeWidth = this.getStrokeWidth()
|
||||
+ 2 * (options.tolerance || 0);
|
||||
strokeWidth = this.getStrokeWidth() + 2 * options.tolerance;
|
||||
switch (shape) {
|
||||
case 'rectangle':
|
||||
var center = getCornerCenter(this, point, strokeWidth);
|
||||
|
|
|
@ -1731,7 +1731,7 @@ var Path = PathItem.extend(/** @lends Path# */{
|
|||
var style = this.getStyle(),
|
||||
segments = this._segments,
|
||||
closed = this._closed,
|
||||
tolerance = options.tolerance || 0,
|
||||
tolerance = options.tolerance,
|
||||
radius = 0, join, cap, miterLimit,
|
||||
that = this,
|
||||
area, loc, res;
|
||||
|
|
Loading…
Reference in a new issue