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 23:32:47 +08:00
parent a173222d74
commit c6e893515c
3 changed files with 474 additions and 473 deletions
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -495,7 +495,7 @@ function prefabLayers(prefab, input) {
const shadow = style.shadowInfos?.find((item) => Number(item?.offset?.x ?? 0) !== 0 || Number(item?.offset?.y ?? 0) !== 0); const shadow = style.shadowInfos?.find((item) => Number(item?.offset?.x ?? 0) !== 0 || Number(item?.offset?.y ?? 0) !== 0);
const fontUuid = textMesh.m_font?.uuid?.uuid; const fontUuid = textMesh.m_font?.uuid?.uuid;
layers.push({ layers.push({
align: Number(style.alignment ?? 0) === 2 ? "right" : Number(style.alignment ?? 0) === 1 ? "left" : "center", align: Number(style.alignment ?? 0) === 2 ? "right" : Number(style.alignment ?? 0) === 1 ? "center" : "left",
...(transform.alpha === 1 ? {} : { alpha: transform.alpha }), ...(transform.alpha === 1 ? {} : { alpha: transform.alpha }),
...(transform.anchorX === 0.5 ? {} : { anchor_x: transform.anchorX }), ...(transform.anchorX === 0.5 ? {} : { anchor_x: transform.anchorX }),
...(transform.anchorY === 0.5 ? {} : { anchor_y: 1 - transform.anchorY }), ...(transform.anchorY === 0.5 ? {} : { anchor_y: 1 - transform.anchorY }),
+1
View File
@@ -98,6 +98,7 @@ describe("POSTV1-ASSET-ALL-16 complete asset catalog", () => {
expect(byId.get("H005")!.render_model.text_layers[1]).toMatchObject({ anchor_y: 0 }); expect(byId.get("H005")!.render_model.text_layers[1]).toMatchObject({ anchor_y: 0 });
expect(byId.get("H005")!.render_model.text_layers[0]).toMatchObject({ vertical_align: "middle" }); expect(byId.get("H005")!.render_model.text_layers[0]).toMatchObject({ vertical_align: "middle" });
expect(byId.get("H005")!.render_model.text_layers[1]).toMatchObject({ vertical_align: "top" }); expect(byId.get("H005")!.render_model.text_layers[1]).toMatchObject({ vertical_align: "top" });
expect(byId.get("H004")!.render_model.text_layers[0]).toMatchObject({ align: "center" });
const heading016Text = byId.get("H016")!.render_model.text_layers; const heading016Text = byId.get("H016")!.render_model.text_layers;
expect(heading016Text).toHaveLength(3); expect(heading016Text).toHaveLength(3);