mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Some minor adjustments and fixes.
This commit is contained in:
parent
2c4dcb96c2
commit
815991d556
2 changed files with 18 additions and 16 deletions
|
@ -1555,20 +1555,20 @@ new function() { // Scope for methods that require private functions
|
||||||
abs(c2[3] - c1[3]) < epsilon &&
|
abs(c2[3] - c1[3]) < epsilon &&
|
||||||
abs(c2[7] - c1[7]) < epsilon) {
|
abs(c2[7] - c1[7]) < epsilon) {
|
||||||
// Overlapping parts are identical
|
// Overlapping parts are identical
|
||||||
var t1 = pairs[0][0],
|
var t11 = pairs[0][0],
|
||||||
t2 = pairs[0][1],
|
t12 = pairs[0][1],
|
||||||
loc = addLocation(locations, include,
|
t21 = pairs[1][0],
|
||||||
curve1, t1, Curve.getPoint(v1, t1),
|
t22 = pairs[1][1],
|
||||||
curve2, t2, Curve.getPoint(v2, t2), true);
|
loc1 = addLocation(locations, include,
|
||||||
if (loc)
|
curve1, t11, Curve.getPoint(v1, t11),
|
||||||
loc._overlap = true;
|
curve2, t12, Curve.getPoint(v2, t12), true),
|
||||||
var t1 = pairs[1][0],
|
loc2 = addLocation(locations, include,
|
||||||
t2 = pairs[1][1];
|
curve1, t21, Curve.getPoint(v1, t21),
|
||||||
loc = addLocation(locations, include,
|
curve2, t22, Curve.getPoint(v2, t22), true);
|
||||||
curve1, t1, Curve.getPoint(v1, t1),
|
if (loc1)
|
||||||
curve2, t2, Curve.getPoint(v2, t2), true);
|
loc1._overlap = true;
|
||||||
if (loc)
|
if (loc2)
|
||||||
loc._overlap = true;
|
loc2._overlap = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1658,10 +1658,11 @@ new function() { // Scope for methods that require private functions
|
||||||
while(--i >= 0) {
|
while(--i >= 0) {
|
||||||
var prev = locations[i];
|
var prev = locations[i];
|
||||||
if (prev.equals(loc)) {
|
if (prev.equals(loc)) {
|
||||||
|
locations.splice(i + 1, 1); // Remove loc.
|
||||||
|
// Preserve overlap setting.
|
||||||
var overlap = loc._overlap;
|
var overlap = loc._overlap;
|
||||||
if (overlap)
|
if (overlap)
|
||||||
prev._overlap = overlap;
|
prev._overlap = overlap;
|
||||||
locations.splice(i + 1, 1); // Remove loc
|
|
||||||
last--;
|
last--;
|
||||||
}
|
}
|
||||||
loc = prev;
|
loc = prev;
|
||||||
|
|
|
@ -287,7 +287,8 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{
|
||||||
// _curve2/_parameter2 are only used for Boolean operations
|
// _curve2/_parameter2 are only used for Boolean operations
|
||||||
// and don't need syncing there.
|
// and don't need syncing there.
|
||||||
&& this._curve2 === loc._curve2
|
&& this._curve2 === loc._curve2
|
||||||
&& abs(this._parameter2 - loc._parameter2) < tolerance
|
&& abs((this._parameter2 || 0) - (loc._parameter2 || 0))
|
||||||
|
< tolerance
|
||||||
|| false;
|
|| false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue