fix(编辑能力): 修复文字编辑与模式切换
build.yaml / build (push) Successful in 47s

This commit is contained in:
xiaoqidun committed 2026-10-24 00:05:33 +08:00
1 parent a9b26b3257
commit 0021228898
3 files changed
+59 -16

No files matched your search

+4 -4
View File
@@ -3407,10 +3407,10 @@ async function toggleEditor() {
const callWASM = (name, ...args) => callTabWASM(tab, name, ...args);
if (!state.doc || !state.ready || document.body.hasAttribute("data-busy") || formDialogOpen()) return;
if (state.editorInfo) {
const openSeq = state.openSeq;
if (!await canvasEditor.commitText() || !isForegroundDocument(tab) || openSeq !== state.openSeq) return;
if (!await canvasEditor.commitCrop()) return;
if (!isForegroundDocument(tab) || openSeq !== state.openSeq) return;
const wasmSeq = state.wasmSeq;
const current = () => !tab.closed && tab.state === state && isForegroundDocument(tab) && wasmSeq === state.wasmSeq;
if (!await canvasEditor.commitText() || !current()) return;
if (!await canvasEditor.commitCrop() || !current()) return;
const anchor = scaleAnchor(0);
state.editing = !state.editing;
renderDocumentFonts();