feat(编辑能力): 修复富文本颜色设置
build.yaml / build (push) Successful in 59s

This commit is contained in:
xiaoqidun committed 2026-10-14 16:27:38 +08:00
1 parent a182f025e1
commit 9791571d75
1 file changed
+3 -2
+3 -2
View File
@@ -3466,12 +3466,13 @@ async function changeTextStyle(color) {
return; return;
} }
const size = color ? item.size : inputMillimeters(el.textSize, item.size); const size = color ? item.size : inputMillimeters(el.textSize, item.size);
const fill = color && el.textColor.value !== item.color ? el.textColor.value : null; const selectedColor = el.textColor.value;
const fill = color && selectedColor !== item.color ? selectedColor : null;
if (item.richText && !canvasEditor.input) { if (item.richText && !canvasEditor.input) {
try { if (!await ensureRichInput()) return; } catch (error) { showError(error, false); return; } try { if (!await ensureRichInput()) return; } catch (error) { showError(error, false); return; }
} }
if (canvasEditor.input) { if (canvasEditor.input) {
canvasEditor.setTextStyle(color ? { color: el.textColor.value } : { size }); canvasEditor.setTextStyle(color ? { color: selectedColor } : { size });
updateObjectControls(canvasEditor.selected, true); updateObjectControls(canvasEditor.selected, true);
return; return;
} }