diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-06 22:49:34 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-06 22:49:34 +0100 |
commit | e0619a658e4a281be9e634dccfe158a818c1773b (patch) | |
tree | 61325b0ae4e3cdd933aaf5528d31ecae3150dee6 /scene | |
parent | 33a83a5eefcdd4bc00a222d302619c37a4879331 (diff) | |
parent | 084a4addc49e6864d9d6c4e1bb7b11d3ad6c9089 (diff) |
Merge pull request #69185 from Sauermann/fix-optionpopup-screentransform
Fix Screen-Transform missing in Button Size in OptionButton::show_popup
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/option_button.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index 027c97b383..dc1d6cc73e 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -491,9 +491,11 @@ void OptionButton::show_popup() { return; } - Size2 button_size = get_global_transform_with_canvas().get_scale() * get_size(); - popup->set_position(get_screen_position() + Size2(0, button_size.height)); - popup->set_size(Size2i(button_size.width, 0)); + Rect2 rect = get_screen_rect(); + rect.position.y += rect.size.height; + rect.size.height = 0; + popup->set_position(rect.position); + popup->set_size(rect.size); // If not triggered by the mouse, start the popup with the checked item (or the first enabled one) focused. if (current != NONE_SELECTED && !popup->is_item_disabled(current)) { |