From dfb5cbc5ebe001ac3996524b7486a2a53e713682 Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Thu, 21 Apr 2011 20:52:28 +0200 Subject: [PATCH] Fix two bugs in the selected items code. --- src/document/Document.js | 4 ++-- src/path/Segment.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/document/Document.js b/src/document/Document.js index 83ae4ed2..2e65e99a 100644 --- a/src/document/Document.js +++ b/src/document/Document.js @@ -72,7 +72,7 @@ var Document = this.Document = Base.extend({ _selectItem: function(item, select) { if (select) { - this.selectedItemCount++; + this._selectedItemCount++; this._selectedItems[item.getId()] = item; } else { this._selectedItemCount--; @@ -101,7 +101,7 @@ var Document = this.Document = Base.extend({ // Todo: use Layer#color context.strokeStyle = context.fillStyle = '#4f7aff'; param = { selection: true }; - Base.each(this.selectedItems, function(item) { + Base.each(this._selectedItems, function(item) { item.draw(context, param); }); context.restore(); diff --git a/src/path/Segment.js b/src/path/Segment.js index bee56923..1048a335 100644 --- a/src/path/Segment.js +++ b/src/path/Segment.js @@ -222,11 +222,11 @@ var Segment = this.Segment = Base.extend({ if (!this._selectionState) { path._selectedSegmentCount--; if (path._selectedSegmentCount == 0) - path._document._selectItem(path, true); + path._document._selectItem(path, false); } else { path._selectedSegmentCount++; if (path._selectedSegmentCount == 1) - path._document._selectItem(path, false); + path._document._selectItem(path, true); } } },