mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Move code to adjust segments after split to CurveLocation.
This commit is contained in:
parent
be2f98d91a
commit
ebc956353f
2 changed files with 7 additions and 4 deletions
|
@ -77,6 +77,12 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{
|
|||
this._segment2 = curve._segment2;
|
||||
},
|
||||
|
||||
_setSegment: function(segment) {
|
||||
this._setCurve(segment.getCurve());
|
||||
this._segment = segment;
|
||||
this._parameter = segment === this._segment1 ? 0 : 1;
|
||||
},
|
||||
|
||||
/**
|
||||
* The segment of the curve which is closer to the described location.
|
||||
*
|
||||
|
|
|
@ -217,10 +217,7 @@ PathItem.inject(new function() {
|
|||
if (noHandles)
|
||||
clearSegments.push(segment);
|
||||
}
|
||||
// TODO: Move setting of these values to CurveLocation
|
||||
loc._segment = segment;
|
||||
loc._parameter = segment === curve._segment1 ? 0 : 1;
|
||||
loc._version = segment._path._version;
|
||||
loc._setSegment(segment);
|
||||
// Link the new segment with the intersection on the other curve
|
||||
var inter = segment._intersection;
|
||||
if (inter) {
|
||||
|
|
Loading…
Reference in a new issue