mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -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;
|
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.
|
* The segment of the curve which is closer to the described location.
|
||||||
*
|
*
|
||||||
|
|
|
@ -217,10 +217,7 @@ PathItem.inject(new function() {
|
||||||
if (noHandles)
|
if (noHandles)
|
||||||
clearSegments.push(segment);
|
clearSegments.push(segment);
|
||||||
}
|
}
|
||||||
// TODO: Move setting of these values to CurveLocation
|
loc._setSegment(segment);
|
||||||
loc._segment = segment;
|
|
||||||
loc._parameter = segment === curve._segment1 ? 0 : 1;
|
|
||||||
loc._version = segment._path._version;
|
|
||||||
// Link the new segment with the intersection on the other curve
|
// Link the new segment with the intersection on the other curve
|
||||||
var inter = segment._intersection;
|
var inter = segment._intersection;
|
||||||
if (inter) {
|
if (inter) {
|
||||||
|
|
Loading…
Reference in a new issue