Fix copied floated selections being entangled
This commit is contained in:
parent
fbf3cb5ae2
commit
dfed3f2db9
@ -521,7 +521,7 @@ class SelectOperation extends MouseOperation {
|
|||||||
if (this.make_copy) {
|
if (this.make_copy) {
|
||||||
if (this.editor.selection.is_floating) {
|
if (this.editor.selection.is_floating) {
|
||||||
// Stamp the floating selection but keep it floating
|
// Stamp the floating selection but keep it floating
|
||||||
this.editor.selection.stamp_float();
|
this.editor.selection.stamp_float(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.editor.selection.enfloat(true);
|
this.editor.selection.enfloat(true);
|
||||||
@ -2363,7 +2363,7 @@ class Selection {
|
|||||||
this.svg_group.append(this.floated_element);
|
this.svg_group.append(this.floated_element);
|
||||||
}
|
}
|
||||||
|
|
||||||
stamp_float() {
|
stamp_float(copy = false) {
|
||||||
if (! this.floated_element)
|
if (! this.floated_element)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -2373,6 +2373,9 @@ class Selection {
|
|||||||
for (let [x, y] of this.iter_cells()) {
|
for (let [x, y] of this.iter_cells()) {
|
||||||
let n = stored_level.coords_to_scalar(x, y);
|
let n = stored_level.coords_to_scalar(x, y);
|
||||||
let cell = this.floated_cells[i];
|
let cell = this.floated_cells[i];
|
||||||
|
if (copy) {
|
||||||
|
cell = cell.map(tile => tile ? {...tile} : null);
|
||||||
|
}
|
||||||
cell.x = x;
|
cell.x = x;
|
||||||
cell.y = y;
|
cell.y = y;
|
||||||
stored_level.linear_cells[n] = cell;
|
stored_level.linear_cells[n] = cell;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user