mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 07:19:57 -05:00
Rename #_countSelectedSegment() to #_updateSelection().
This commit is contained in:
parent
3e7806ae50
commit
8130ee458f
2 changed files with 4 additions and 4 deletions
|
@ -238,7 +238,7 @@ var Path = this.Path = PathItem.extend({
|
|||
// If parts of this segment are selected, adjust the internal
|
||||
// _selectedSegmentCount now
|
||||
if (segment._selectionState)
|
||||
this._countSelectedSegment(segment);
|
||||
this._updateSelection(segment);
|
||||
}
|
||||
if (append) {
|
||||
// Append them all at the end by using push
|
||||
|
@ -268,7 +268,7 @@ var Path = this.Path = PathItem.extend({
|
|||
return segs;
|
||||
},
|
||||
|
||||
_countSelectedSegment: function(segment) {
|
||||
_updateSelection: function(segment) {
|
||||
var count = this._selectedSegmentCount +=
|
||||
segment._selectionState ? 1 : -1;
|
||||
if (count <= 1)
|
||||
|
@ -368,7 +368,7 @@ var Path = this.Path = PathItem.extend({
|
|||
var segment = removed[i];
|
||||
if (segment._selectionState) {
|
||||
segment._selectionState = 0;
|
||||
this._countSelectedSegment(segment);
|
||||
this._updateSelection(segment);
|
||||
}
|
||||
// Clear the indices and path references of the removed segments
|
||||
removed._index = removed._path = undefined;
|
||||
|
|
|
@ -289,7 +289,7 @@ var Segment = this.Segment = Base.extend({
|
|||
// it's path know and possibly add or remove it from
|
||||
// project._selectedItems
|
||||
if (path && wasSelected != !!this._selectionState)
|
||||
path._countSelectedSegment(this);
|
||||
path._updateSelection(this);
|
||||
},
|
||||
|
||||
// DOCS: Segment#selected
|
||||
|
|
Loading…
Reference in a new issue