mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2025-01-10 06:32:07 -05:00
Fix the undo bug, but this time it's more real
This commit is contained in:
parent
7aa74d7ffd
commit
ddca91a567
1 changed files with 5 additions and 5 deletions
|
@ -50,6 +50,10 @@ class SelectionBoxTool {
|
|||
Math.round(this.selectionRect.bounds.height),
|
||||
);
|
||||
|
||||
// Remove dotted rectangle
|
||||
this.selectionRect.remove();
|
||||
this.selectionRect = null;
|
||||
|
||||
if (rect.area) {
|
||||
// Pull selected raster to active layer
|
||||
const raster = getRaster().getSubRaster(rect);
|
||||
|
@ -62,14 +66,10 @@ class SelectionBoxTool {
|
|||
raster.data = {expanded: expanded};
|
||||
|
||||
// Clear area from raster layer
|
||||
const context = getRaster().canvas.getContext('2d');
|
||||
const context = getRaster().getContext(true /* modify */);
|
||||
context.clearRect(rect.x, rect.y, rect.width, rect.height);
|
||||
this.setSelectedItems();
|
||||
}
|
||||
|
||||
// Remove dotted rectangle
|
||||
this.selectionRect.remove();
|
||||
this.selectionRect = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue