Fix clearing of removed segments.

This commit is contained in:
Jürg Lehni 2012-12-31 21:45:30 +01:00
parent a10e44d601
commit f0038465cc

View file

@ -530,8 +530,7 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
* path.selected = true; * path.selected = true;
*/ */
removeSegment: function(index) { removeSegment: function(index) {
var segments = this.removeSegments(index, index + 1); return this.removeSegments(index, index + 1)[0] || null;
return segments[0] || null;
}, },
/** /**
@ -579,7 +578,7 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
if (segment._selectionState) if (segment._selectionState)
this._updateSelection(segment, segment._selectionState, 0); this._updateSelection(segment, segment._selectionState, 0);
// Clear the indices and path references of the removed segments // Clear the indices and path references of the removed segments
removed._index = removed._path = undefined; segment._index = segment._path = undefined;
} }
// Adjust the indices of the segments above. // Adjust the indices of the segments above.
for (var i = from, l = segments.length; i < l; i++) for (var i = from, l = segments.length; i < l; i++)