Path#setSegments: reset _selectedSegmentCount when setting a new segment list.

This commit is contained in:
Jonathan Puckey 2011-04-22 11:39:12 +02:00
parent 11063af8df
commit 4d89d6c235
2 changed files with 11 additions and 1 deletions

View file

@ -417,7 +417,7 @@ var Path = this.Path = PathItem.extend({
this[name] = value;
}, []);
} else {
this._segments.length = 0;
this._segments.length = this._selectedSegmentCount = 0;
}
for(var i = 0; i < length; i++) {
this._add(Segment.read(segments, i, 1));

View file

@ -75,4 +75,14 @@ test('path.remove()', function() {
path.remove();
equals(doc.activeLayer.children.length, 0);
});
test('path.remove()', function() {
var doc = new Document();
var path = new Path([0, 0]);
path.selected = true;
equals(path.selected, true);
path.segments = [[0, 10]];
equals(path.selected, false);
});