mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Make sure Segment#getLocation() always determines the right value for CurveLocation#parameter
Half the solution for #437.
This commit is contained in:
parent
0f5e74a08e
commit
c464f9ce1b
1 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue