summaryrefslogtreecommitdiff
path: root/scene/gui/menu_button.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/menu_button.cpp')
-rw-r--r--scene/gui/menu_button.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp
index 737ba84617..0cc53a7832 100644
--- a/scene/gui/menu_button.cpp
+++ b/scene/gui/menu_button.cpp
@@ -87,15 +87,15 @@ void MenuButton::_popup_visibility_changed(bool p_visible) {
void MenuButton::pressed() {
emit_signal(SNAME("about_to_popup"));
- Size2 size = get_size();
+ Size2 size = get_size() * get_viewport()->get_canvas_transform().get_scale();
Point2 gp = get_screen_position();
- gp.y += get_size().y;
+ gp.y += size.y;
popup->set_position(gp);
popup->set_size(Size2(size.width, 0));
- popup->set_parent_rect(Rect2(Point2(gp - popup->get_position()), get_size()));
+ popup->set_parent_rect(Rect2(Point2(gp - popup->get_position()), size));
popup->take_mouse_focus();
popup->popup();
}