mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
code minifier
This commit is contained in:
parent
19bcd19b49
commit
e15b23f8af
2 changed files with 14 additions and 15 deletions
|
@ -87,9 +87,9 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{
|
||||||
|
|
||||||
setMinDistance: function(minDistance) {
|
setMinDistance: function(minDistance) {
|
||||||
this._minDistance = minDistance;
|
this._minDistance = minDistance;
|
||||||
if (this._minDistance != null && this._maxDistance != null
|
if (minDistance != null && this._maxDistance != null
|
||||||
&& this._minDistance > this._maxDistance) {
|
&& minDistance > this._maxDistance) {
|
||||||
this._maxDistance = this._minDistance;
|
this._maxDistance = minDistance;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -106,8 +106,8 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{
|
||||||
|
|
||||||
setMaxDistance: function(maxDistance) {
|
setMaxDistance: function(maxDistance) {
|
||||||
this._maxDistance = maxDistance;
|
this._maxDistance = maxDistance;
|
||||||
if (this._minDistance != null && this._maxDistance != null
|
if (this._minDistance != null && maxDistance != null
|
||||||
&& this._maxDistance < this._minDistance) {
|
&& maxDistance < this._minDistance) {
|
||||||
this._minDistance = maxDistance;
|
this._minDistance = maxDistance;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -290,10 +290,9 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{
|
||||||
return false;
|
return false;
|
||||||
// Produce a new point on the way to point if point is further
|
// Produce a new point on the way to point if point is further
|
||||||
// away than maxDistance
|
// away than maxDistance
|
||||||
var maxDist = maxDistance != null ? maxDistance : 0;
|
if (maxDistance != null && maxDistance != 0) {
|
||||||
if (maxDist != 0) {
|
if (distance > maxDistance) {
|
||||||
if (distance > maxDist) {
|
point = this._point.add(vector.normalize(maxDistance));
|
||||||
point = this._point.add(vector.normalize(maxDist));
|
|
||||||
} else if (matchMaxDistance) {
|
} else if (matchMaxDistance) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue