mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42: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) {
|
_selectItem: function(item, select) {
|
||||||
if (select) {
|
if (select) {
|
||||||
this.selectedItemCount++;
|
this._selectedItemCount++;
|
||||||
this._selectedItems[item.getId()] = item;
|
this._selectedItems[item.getId()] = item;
|
||||||
} else {
|
} else {
|
||||||
this._selectedItemCount--;
|
this._selectedItemCount--;
|
||||||
|
@ -101,7 +101,7 @@ var Document = this.Document = Base.extend({
|
||||||
// Todo: use Layer#color
|
// Todo: use Layer#color
|
||||||
context.strokeStyle = context.fillStyle = '#4f7aff';
|
context.strokeStyle = context.fillStyle = '#4f7aff';
|
||||||
param = { selection: true };
|
param = { selection: true };
|
||||||
Base.each(this.selectedItems, function(item) {
|
Base.each(this._selectedItems, function(item) {
|
||||||
item.draw(context, param);
|
item.draw(context, param);
|
||||||
});
|
});
|
||||||
context.restore();
|
context.restore();
|
||||||
|
|
|
@ -222,11 +222,11 @@ var Segment = this.Segment = Base.extend({
|
||||||
if (!this._selectionState) {
|
if (!this._selectionState) {
|
||||||
path._selectedSegmentCount--;
|
path._selectedSegmentCount--;
|
||||||
if (path._selectedSegmentCount == 0)
|
if (path._selectedSegmentCount == 0)
|
||||||
path._document._selectItem(path, true);
|
path._document._selectItem(path, false);
|
||||||
} else {
|
} else {
|
||||||
path._selectedSegmentCount++;
|
path._selectedSegmentCount++;
|
||||||
if (path._selectedSegmentCount == 1)
|
if (path._selectedSegmentCount == 1)
|
||||||
path._document._selectItem(path, false);
|
path._document._selectItem(path, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue