YaolongHan 4 tahun lalu
induk
melakukan
93bd25adb8
1 mengubah file dengan 5 tambahan dan 5 penghapusan
  1. 5 5
      src/components/mapClass/EditScence.ts

+ 5 - 5
src/components/mapClass/EditScence.ts

@@ -475,10 +475,11 @@ export class EditScence extends SGraphScene {
      */
     updatedText(str: string): void {
         if (this.focusItem) {
-            const old = this.focusItem.text;
+            const oldMsg = this.focusItem.text;
+            const newMsg = str;
             this.focusItem.text = str;
+            this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "text", oldMsg, newMsg));
             this.scenceUpdate(this);
-            // this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "text", old, str));
         }
     }
 
@@ -492,8 +493,7 @@ export class EditScence extends SGraphScene {
             let font = new SFont(this.focusItem.font);
             font.size = size;
             this.focusItem.font = font;
-            // this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "font", old, font));
-
+            this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "font", old, font));
         }
     }
 
@@ -636,9 +636,9 @@ export class EditScence extends SGraphScene {
             } else if (val == 'solid') {
                 borderStyle = SLineStyle.Soild;
             }
-            this.focusItem.lineStyle = borderStyle;
             const newMsg = borderStyle;
             const oldMsg =  this.focusItem.lineStyle;
+            this.focusItem.lineStyle = borderStyle;
             this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "lineStyle", oldMsg, newMsg));
         }
     }