mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Some CurveLocation cleanup.
- Remove UID as there is no need anymore - Rename some private properties
This commit is contained in:
parent
0ae232e4ab
commit
00d2e2a5bb
2 changed files with 6 additions and 10 deletions
|
@ -51,17 +51,13 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{
|
||||||
curve = next;
|
curve = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Define this CurveLocation's unique id.
|
|
||||||
// NOTE: We do not use the same pool as the rest of the library here,
|
|
||||||
// since this is only required to be unique at runtime among other
|
|
||||||
// CurveLocation objects.
|
|
||||||
this._id = UID.get(CurveLocation);
|
|
||||||
this._setCurve(curve);
|
this._setCurve(curve);
|
||||||
this._time = time;
|
this._time = time;
|
||||||
this._point = point || curve.getPointAtTime(time);
|
this._point = point || curve.getPointAtTime(time);
|
||||||
this._overlap = _overlap;
|
this._overlap = _overlap;
|
||||||
this._distance = _distance;
|
this._distance = _distance;
|
||||||
this._intersection = this._next = this._prev = null;
|
// Properties related to linked intersection locations
|
||||||
|
this._intersection = this._next = this._previous = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
_setCurve: function(curve) {
|
_setCurve: function(curve) {
|
||||||
|
|
|
@ -206,7 +206,7 @@ PathItem.inject(new function() {
|
||||||
while (prev) {
|
while (prev) {
|
||||||
if (prev === to)
|
if (prev === to)
|
||||||
return;
|
return;
|
||||||
prev = prev._prev;
|
prev = prev._previous;
|
||||||
}
|
}
|
||||||
// Now walk to the end of the existing chain to find an empty spot, but
|
// Now walk to the end of the existing chain to find an empty spot, but
|
||||||
// stop if we find `to`, to avoid adding it again.
|
// stop if we find `to`, to avoid adding it again.
|
||||||
|
@ -215,10 +215,10 @@ PathItem.inject(new function() {
|
||||||
// If we're reached the end of the list, we can add it.
|
// If we're reached the end of the list, we can add it.
|
||||||
if (!from._next) {
|
if (!from._next) {
|
||||||
// Go back to beginning of the other chain, and link the two up.
|
// Go back to beginning of the other chain, and link the two up.
|
||||||
while (to._prev)
|
while (to._previous)
|
||||||
to = to._prev;
|
to = to._previous;
|
||||||
from._next = to;
|
from._next = to;
|
||||||
to._prev = from;
|
to._previous = from;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue