mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 10:48:38 -05:00
Path#setSegments: reset _selectedSegmentCount when setting a new segment list.
This commit is contained in:
parent
11063af8df
commit
4d89d6c235
2 changed files with 11 additions and 1 deletions
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
});
|
Loading…
Reference in a new issue