You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Fix Screen-Transform missing in Button Size in OptionButton::show_popup
The button size is affected by the screen transform, which was previously not taken into consideration.
This commit is contained in:
@@ -491,9 +491,11 @@ void OptionButton::show_popup() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Size2 button_size = get_global_transform_with_canvas().get_scale() * get_size();
|
Rect2 rect = get_screen_rect();
|
||||||
popup->set_position(get_screen_position() + Size2(0, button_size.height));
|
rect.position.y += rect.size.height;
|
||||||
popup->set_size(Size2i(button_size.width, 0));
|
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 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)) {
|
if (current != NONE_SELECTED && !popup->is_item_disabled(current)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user