fix: TextContent 的 loc 允许动态传入

This commit is contained in:
AncTe committed 2026-10-28 21:47:06 +08:00
1 parent e69dc0af06
commit f5f8322985
1 file changed
+4 -5
@@ -161,14 +161,13 @@ export const TextContent = defineComponent<
const updateLoc = () => {
const height = getHeight();
if (props.autoHeight) {
const [x = 0, y = 0, width = props.width, , ax = 0, ay = 0] =
loc.value;
loc.value = [x, y, width, height, ax, ay];
}
const [x = 0, y = 0, , h = 0, ax = 0, ay = 0] = props.loc ?? loc.value;
loc.value = [x, y, props.width, props.autoHeight ? height : h, ax, ay];
emit('updateHeight', height);
};
watch(() => props.loc, updateLoc);
expose<TextContentExpose>({ retype, showAll, getHeight });
const spriteElement = shallowRef<CustomRenderItem>();