mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Fix two bugs in the selected items code.
This commit is contained in:
parent
be8ee90f75
commit
dfb5cbc5eb
2 changed files with 4 additions and 4 deletions
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue