Fix a couple places the editor wasn't redrawing

This commit is contained in:
Eevee (Evelyn Woods) 2021-01-10 14:38:37 -07:00
parent 69296dff67
commit fb1e749a28

View File

@ -520,6 +520,8 @@ class SelectOperation extends MouseOperation {
if (! this.has_moved) { if (! this.has_moved) {
if (this.make_copy) { if (this.make_copy) {
// FIXME support directly making a copy of a copy // FIXME support directly making a copy of a copy
// FIXME currently the floating preview isn't right because there's no redraw
// between these steps
this.editor.selection.defloat(); this.editor.selection.defloat();
this.editor.selection.enfloat(true); this.editor.selection.enfloat(true);
} }
@ -701,6 +703,7 @@ class TrackOperation extends DrawOperation {
// Draw // Draw
terrain.tracks |= bit; terrain.tracks |= bit;
} }
this.editor.mark_cell_dirty(cell);
} }
else if (! this.alt_mode) { else if (! this.alt_mode) {
terrain = { type: TILE_TYPES['railroad'] }; terrain = { type: TILE_TYPES['railroad'] };
@ -754,6 +757,7 @@ class WireOperation extends DrawOperation {
else { else {
terrain.wire_tunnel_directions |= bit; terrain.wire_tunnel_directions |= bit;
} }
this.editor.mark_cell_dirty(cell);
} }
return; return;
} }
@ -2366,8 +2370,11 @@ class Selection {
let i = 0; let i = 0;
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);
stored_level.linear_cells[n] = this.floated_cells[i]; let cell = this.floated_cells[i];
this.editor.mark_cell_dirty(stored_level.linear_cells[n]); cell.x = x;
cell.y = y;
stored_level.linear_cells[n] = cell;
this.editor.mark_cell_dirty(cell);
i += 1; i += 1;
} }
this.floated_element.remove(); this.floated_element.remove();