From f5f83229851c910b05db33834d7e0f65d7b5120b Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Wed, 28 Oct 2026 21:47:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20TextContent=20=E7=9A=84=20loc=20?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=8A=A8=E6=80=81=E4=BC=A0=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages-user/client-base/src/components/textbox.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages-user/client-base/src/components/textbox.tsx b/packages-user/client-base/src/components/textbox.tsx index b17e988..5b58de6 100644 --- a/packages-user/client-base/src/components/textbox.tsx +++ b/packages-user/client-base/src/components/textbox.tsx @@ -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({ retype, showAll, getHeight }); const spriteElement = shallowRef();