Move code to adjust segments after split to CurveLocation.

This commit is contained in:
Jürg Lehni 2015-10-04 02:25:33 +02:00
parent be2f98d91a
commit ebc956353f
2 changed files with 7 additions and 4 deletions

View file

@ -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.
*

View file

@ -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) {