Allow #removeSegments() to be called without arguments, in which case all segments are removed.

This commit is contained in:
Jürg Lehni 2011-04-28 19:02:34 +01:00
parent ea510c2403
commit 121ec5a93f

View file

@ -116,8 +116,10 @@ var Path = this.Path = PathItem.extend({
// TODO: Port back to Sg
removeSegments: function(from, to) {
for(var i = to; i >= from; i--)
this.removeSegment(i);
var i = Base.pick(to, this._segments.length),
from = from || 0;
while (i >= from)
this.removeSegment(i--);
},
isSelected: function() {