From c464f9ce1b99e41308190b64e9d2e7c4a8fffb80 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrg=20Lehni?= <juerg@scratchdisk.com>
Date: Sun, 30 Mar 2014 14:16:03 +0200
Subject: [PATCH] Make sure Segment#getLocation() always determines the right
 value for CurveLocation#parameter

Half the solution for #437.
---
 src/path/Segment.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/path/Segment.js b/src/path/Segment.js
index 306739ab..329e730c 100644
--- a/src/path/Segment.js
+++ b/src/path/Segment.js
@@ -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;
 	},
 
 	/**