1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00

Constrain menus to the screen

This commit is contained in:
Emil Ernerfeldt
2023-01-26 11:13:21 +01:00
parent 8ce0e1c520
commit 5b1cad2b72
2 changed files with 3 additions and 1 deletions

View File

@@ -143,9 +143,10 @@ pub(crate) fn menu_ui<'c, R>(
let area = Area::new(menu_id)
.order(Order::Foreground)
.constrain(true)
.fixed_pos(pos)
.interactable(true)
.drag_bounds(Rect::EVERYTHING);
.drag_bounds(ctx.screen_rect());
let inner_response = area.show(ctx, |ui| {
set_menu_style(ui.style_mut());