Skip to content

Commit

Permalink
Merge pull request #68573 from Sauermann/fix-optionbutton-popup
Browse files Browse the repository at this point in the history
Fix position and size of OptionButton PopupMenu
  • Loading branch information
akien-mga committed Nov 16, 2022
2 parents 6d2a7cb + 95597bb commit 2846ea1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scene/gui/option_button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,9 @@ void OptionButton::show_popup() {
return;
}

Size2 size = get_size() * get_viewport()->get_canvas_transform().get_scale();
popup->set_position(get_screen_position() + Size2(0, size.height * get_global_transform().get_scale().y));
popup->set_size(Size2(size.width, 0));
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));

// 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)) {
Expand Down

0 comments on commit 2846ea1

Please sign in to comment.