Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MenuBar popup placement assuming it's in viewport default canvas #92841

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions scene/gui/menu_bar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ void MenuBar::_open_popup(int p_index, bool p_focus_item) {
}

Rect2 item_rect = _get_menu_item_rect(p_index);
Point2 screen_pos = get_screen_position() + item_rect.position * get_viewport()->get_canvas_transform().get_scale();
Size2 screen_size = item_rect.size * get_viewport()->get_canvas_transform().get_scale();
Size2 canvas_scale = get_canvas_transform().get_scale();
Point2 screen_pos = get_screen_position() + item_rect.position * canvas_scale;
Size2 screen_size = item_rect.size * canvas_scale;

active_menu = p_index;

Expand Down
Loading