mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -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;
|
||||
}
|
||||
}
|
||||
// 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._time = time;
|
||||
this._point = point || curve.getPointAtTime(time);
|
||||
this._overlap = _overlap;
|
||||
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) {
|
||||
|
|
|
@ -206,7 +206,7 @@ PathItem.inject(new function() {
|
|||
while (prev) {
|
||||
if (prev === to)
|
||||
return;
|
||||
prev = prev._prev;
|
||||
prev = prev._previous;
|
||||
}
|
||||
// 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.
|
||||
|
@ -215,10 +215,10 @@ PathItem.inject(new function() {
|
|||
// If we're reached the end of the list, we can add it.
|
||||
if (!from._next) {
|
||||
// Go back to beginning of the other chain, and link the two up.
|
||||
while (to._prev)
|
||||
to = to._prev;
|
||||
while (to._previous)
|
||||
to = to._previous;
|
||||
from._next = to;
|
||||
to._prev = from;
|
||||
to._previous = from;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue