@@ -270,7 +270,7 @@ export default {
270
270
commit ( "showNotification" , { message : translate ( isCut ? "selectionCut" : "selectionCopied" ) } ) ;
271
271
} ,
272
272
async requestSelectionCut ( { dispatch } : ActionContext < BitMapperyState , any > ) : Promise < void > {
273
- dispatch ( "requestSelectionCopy" , { merged : false , isCut : true } ) ;
273
+ await dispatch ( "requestSelectionCopy" , { merged : false , isCut : true } ) ;
274
274
dispatch ( "deleteInSelection" ) ;
275
275
} ,
276
276
clearSelection ( ) : void {
@@ -310,21 +310,22 @@ export default {
310
310
if ( ! activeLayer || ! getters . activeDocument ?. activeSelection . length ) {
311
311
return ;
312
312
}
313
- const hasMask = ! ! activeLayer . mask ;
313
+ const hasMask = ! ! activeLayer . mask && getters . activeLayerMask === activeLayer . mask ;
314
314
const orgContent = cloneCanvas ( hasMask ? activeLayer . mask : activeLayer . source ) ;
315
315
const updatedBitmap = deleteSelectionContent ( getters . activeDocument , activeLayer ) ;
316
+
316
317
const replaceSource = ( newSource : HTMLCanvasElement ) => {
317
318
replaceLayerSource ( activeLayer , newSource , hasMask ) ;
318
319
getRendererForLayer ( activeLayer ) ?. resetFilterAndRecache ( ) ;
319
320
} ;
320
321
replaceSource ( updatedBitmap ) ;
321
322
enqueueState ( `deleteFromSelection_${ activeLayer . id } ` , {
322
- undo ( ) {
323
+ undo ( ) : void {
323
324
replaceSource ( orgContent ) ;
324
325
} ,
325
- redo ( ) {
326
+ redo ( ) : void {
326
327
replaceSource ( updatedBitmap ) ;
327
- }
328
+ } ,
328
329
} ) ;
329
330
} ,
330
331
/**
0 commit comments