Jelajahi Sumber

fix: 二轮测试问题

wzl 7 bulan lalu
induk
melakukan
95c19551b6

+ 6 - 1
packages/core/src/editor/content_container.js

@@ -313,6 +313,11 @@ export class ContentContainer {
     this._selectedFrameIndex = index
   }
 
+  removeEditor (index) {
+    this.frameEditorList.splice(index, 1)
+    this.frameEditorList.forEach((editor, i) => editor.editAreaIndex = i)
+  }
+
   handleKeyDown (e) {
     const selectedEditor = this.frameEditorList[this._selectedFrameIndex]
     if (!selectedEditor || selectedEditor.state !== 1) return
@@ -369,7 +374,7 @@ export class ContentContainer {
     const editor = this.frameEditorList.find(item => item.editAreaPtr === editAreaPtr)
     if (editor) {
       editor.updateCanvasAfterUndoRedo()
-      editor.type === 'text' && editCharPlace && editor.updateCursorLine(editCharPlace)
+      editor.type === 'text' && (editCharPlace.CharIndex !== -1 || editCharPlace.LineIndex !== -1 || editCharPlace.RunIndex !== -1 || editCharPlace.SectionIndex !== -1 ) && editor.updateCursorLine(editCharPlace)
       return
     }
 

+ 1 - 0
packages/core/src/editor/text_editor.js

@@ -1812,5 +1812,6 @@ export class TextEditor {
 
     this.drawCanvas()
     this.saveEdit()
+    this.getTextStyle()
   }
 }