From 4d89d6c23529da3766b93f2aa04cec46d47ef86a Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Fri, 22 Apr 2011 11:39:12 +0200 Subject: [PATCH] Path#setSegments: reset _selectedSegmentCount when setting a new segment list. --- src/path/Path.js | 2 +- test/tests/Path.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/path/Path.js b/src/path/Path.js index 4d04d2f7..fc19ff87 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -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)); diff --git a/test/tests/Path.js b/test/tests/Path.js index 1a21dec0..99bf6a70 100644 --- a/test/tests/Path.js +++ b/test/tests/Path.js @@ -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); }); \ No newline at end of file