Explorar o código

feat:增加删除相关操作

YaolongHan %!s(int64=4) %!d(string=hai) anos
pai
achega
e045634251
Modificáronse 1 ficheiros con 6 adicións e 3 borrados
  1. 6 3
      src/components/mapClass/EditScence.ts

+ 6 - 3
src/components/mapClass/EditScence.ts

@@ -906,6 +906,7 @@ export class EditScence extends SGraphScene {
         }
         if (this.grabItem) {
             this.grabItem.onKeyDown(event);
+            // 创建时按esc键取消
             if (event.code == "Escape") {
                 const item = this.grabItem;
                 this.grabItem = null
@@ -916,9 +917,11 @@ export class EditScence extends SGraphScene {
                 this.setCmd = 'choice'
             }
         }
-        // if (event.key == "Enter") {
-        //     this.cmd = 0
-        // }
+        //delete键删除item
+        if(event.code == "Delete"){
+          this.deleiteItem()
+        }
+
         return false
     }