fix(编辑能力): 修正文本框自适应与对齐
build.yaml / build (push) Successful in 45s

This commit is contained in:
xiaoqidun committed 2026-10-27 23:45:29 +08:00
1 parent d384527371
commit 7e3f2c468a
6 files changed
+59 -9

No files matched your search

+1 -1
View File
@@ -4314,7 +4314,7 @@ async function beginCanvasText(index, box, surface, page) {
const node = document.createElement("div");
const item = { ...state.textDefaults, ...box, wrap: state.textDefaults.wrapOverride ?? box.wrap ?? state.textDefaults.wrap,
index, page, surface, node, text: "", draft: true, fontData: data };
const model = richTextModel(item);
const model = { ...richTextModel(item), autoWidth: !box.wrap };
const key = `temp-font-${crypto.randomUUID()}`;
model.runs[0].format.font = key;
canvasEditor.editText(item, face, null, { model, faces: new Map([[key, face]]), fonts: [{ key, data }] });