fix(POSTV1-TEMPLATE-LAYOUT-19): 按原始文本框修复模板偏移
Dada P0-A isolated Windows CI / validate-and-package (push) Waiting to run

This commit is contained in:
suyx
2026-08-06 19:01:33 +08:00
parent 5e8a491f2a
commit f244920a61
5 changed files with 575 additions and 14 deletions
+4
View File
@@ -518,6 +518,9 @@ function prefabLayers(prefab, input) {
stroke_width: Math.max(0, Number(outline?.outlineSize ?? 0)),
text: String(textMesh.m_text ?? ""),
type: "text",
vertical_align: Number(style.vAlignment ?? 1) === 0 ? "top"
: Number(style.vAlignment ?? 1) === 2 ? "bottom"
: "middle",
width: Math.max(1, Number(object.m_contentSize?.width ?? 1) * Math.abs(scaleX)),
x: transform.x,
y: -transform.y,
@@ -762,6 +765,7 @@ export function compileTextTemplateAssets({ templateDirectory, templateId }) {
stroke_width: 0,
text: value,
type: "text",
vertical_align: "middle",
width: Math.max(96, Array.from(value).length * 52),
x: 0,
y: 0,