Fix error when nothing is selected

This commit is contained in:
Metachs 2024-08-26 15:55:35 -04:00
parent 954a2ac0ec
commit a24bc7eb60

View file

@ -718,7 +718,7 @@ const selectTransformTool = () =>
// Only checks if Selection exists and content has been selected // Only checks if Selection exists and content has been selected
// Does not check if content has been transformed, eg for deletion/applying to new layer // Does not check if content has been transformed, eg for deletion/applying to new layer
state.applyTransform = async (eraseSelected = false, clearLayer = false, newLayer = null, keepOriginal = false) => { state.applyTransform = async (eraseSelected = false, clearLayer = false, newLayer = null, keepOriginal = false) => {
const isBlank = const isBlank = !state.selected ||
isCanvasBlank( 0, 0, state.selected.canvas.width, state.selected.canvas.height, state.selected.canvas); isCanvasBlank( 0, 0, state.selected.canvas.width, state.selected.canvas.height, state.selected.canvas);
// Just reset state if nothing is selected, unless Clearing layer // Just reset state if nothing is selected, unless Clearing layer