From b680301ce8d2f136bb13ba3a475d56a66959b45b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 8 Jan 2016 16:52:56 +0100 Subject: [PATCH] Fix issue where locations reference the wrong path after splitting. --- src/path/CurveLocation.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/path/CurveLocation.js b/src/path/CurveLocation.js index 76abd23a..46e04096 100644 --- a/src/path/CurveLocation.js +++ b/src/path/CurveLocation.js @@ -67,8 +67,11 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{ _setCurve: function(curve) { var path = curve._path; - this._version = path ? path._version : 0; + // We only store the path to verify versions for cachd values. + // To ensure we use the right path (e.g. after splitting), we shall + // always access the path on the result of getCurve(). this._path = path; + this._version = path ? path._version : 0; this._curve = curve; this._segment = null; // To be determined, see #getSegment() // Also store references to segment1 and segment2, in case path @@ -121,7 +124,7 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{ * @bean */ getCurve: function() { - path = this._path, + var path = this._path, that = this; if (path && path._version !== this._version) { // If the path's segments have changed in the meantime, clear the @@ -158,7 +161,8 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{ * @bean */ getPath: function() { - return this._path; + var curve = this.getCurve(); + return curve && curve._path; }, /**