mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
Have newly added segments selected if path was fully selected before.
This commit is contained in:
parent
658fc4b2ff
commit
8213dce4a9
1 changed files with 5 additions and 1 deletions
|
@ -235,7 +235,8 @@ var Path = this.Path = PathItem.extend({
|
||||||
curves = this._curves,
|
curves = this._curves,
|
||||||
amount = segs.length,
|
amount = segs.length,
|
||||||
append = index == null,
|
append = index == null,
|
||||||
index = append ? segments.length : index;
|
index = append ? segments.length : index,
|
||||||
|
fullySelected = this.isFullySelected();
|
||||||
// Scan through segments to add first, convert if necessary and set
|
// Scan through segments to add first, convert if necessary and set
|
||||||
// _path and _index references on them.
|
// _path and _index references on them.
|
||||||
for (var i = 0; i < amount; i++) {
|
for (var i = 0; i < amount; i++) {
|
||||||
|
@ -247,6 +248,9 @@ var Path = this.Path = PathItem.extend({
|
||||||
}
|
}
|
||||||
segment._path = this;
|
segment._path = this;
|
||||||
segment._index = index + i;
|
segment._index = index + i;
|
||||||
|
// Select newly added segments if path was fully selected before
|
||||||
|
if (fullySelected)
|
||||||
|
segment._selectionState = SelectionState.POINT;
|
||||||
// If parts of this segment are selected, adjust the internal
|
// If parts of this segment are selected, adjust the internal
|
||||||
// _selectedSegmentState now
|
// _selectedSegmentState now
|
||||||
if (segment._selectionState)
|
if (segment._selectionState)
|
||||||
|
|
Loading…
Reference in a new issue