Make sure Segment#getLocation() always determines the right value for CurveLocation#parameter

Half the solution for #437.
This commit is contained in:
Jürg Lehni 2014-03-30 14:16:03 +02:00
parent 0f5e74a08e
commit c464f9ce1b

View file

@ -401,10 +401,10 @@ var Segment = Base.extend(/** @lends Segment# */{
*/
getLocation: function() {
var curve = this.getCurve();
// Determine whether the parameter for this segment is 0 or 1 based on
// whether there is a next curve or not, as #getNext() takes closed into
// account and all.
return curve ? new CurveLocation(curve, curve.getNext() ? 0 : 1) : null;
return curve
// Determine whether the parameter for this segment is 0 or 1.
? new CurveLocation(curve, this === curve._segment1 ? 0 : 1)
: null;
},
/**