fix(ui): 修正按钮边界矩形计算使用错误的位置

使用convertToWorldSpace替代getRenderPosition来正确计算边界矩形,确保在不同坐标系转换下边界计算准确
This commit is contained in:
ChestnutYueyue 2026-02-26 00:15:45 +08:00
parent fa9ee0e2a7
commit 0f520c8e37
1 changed files with 1 additions and 1 deletions

View File

@ -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();