From 0f520c8e374ccbc2c4304a46da25f2852681eefe Mon Sep 17 00:00:00 2001 From: ChestnutYueyue <952134128@qq.com> Date: Thu, 26 Feb 2026 00:15:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E4=BF=AE=E6=AD=A3=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E8=BE=B9=E7=95=8C=E7=9F=A9=E5=BD=A2=E8=AE=A1=E7=AE=97=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E9=94=99=E8=AF=AF=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用convertToWorldSpace替代getRenderPosition来正确计算边界矩形,确保在不同坐标系转换下边界计算准确 --- src/ui/button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/button.cpp b/src/ui/button.cpp index b44cc52..7cf2e4a 100644 --- a/src/ui/button.cpp +++ b/src/ui/button.cpp @@ -357,7 +357,7 @@ void Button::setCustomSize(float width, float height) { * @return 边界矩形 */ Rect Button::getBoundingBox() const { - auto pos = getRenderPosition(); + auto pos = convertToWorldSpace(extra2d::Vec2::Zero()); auto anchor = getAnchor(); auto scale = getScale(); auto size = getSize();