From 181b5e8434444adc0888f92bf1bbe5fb958c19a9 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sun, 7 Nov 2021 19:28:37 +0100 Subject: [PATCH] Don't clip popups to the parent cliprect Closes https://github.com/emilk/egui/issues/825 --- CHANGELOG.md | 3 +++ egui/src/containers/popup.rs | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83fd7aa6a84..98a9b63b4a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,9 @@ NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui_w * Replace `Ui::__test` with `egui::__run_test_ui` ([#872](https://github.com/emilk/egui/pull/872)). * Replace `scroll_delta` and `zoom_delta` in `RawInput` with `Event::Scroll` and `Event::Zoom`. +### Fixed 🐛 +* Fix `ComboBox` and other popups getting clipped to parent window ([#885](https://github.com/emilk/egui/pull/885)). + ### Removed 🔥 * Removed `egui::math` (use `egui::emath` instead). * Removed `egui::paint` (use `egui::epaint` instead). diff --git a/egui/src/containers/popup.rs b/egui/src/containers/popup.rs index 5549fa10c52..1194f12b869 100644 --- a/egui/src/containers/popup.rs +++ b/egui/src/containers/popup.rs @@ -287,13 +287,12 @@ pub fn popup_below_widget( add_contents: impl FnOnce(&mut Ui) -> R, ) -> Option { if ui.memory().is_popup_open(popup_id) { - let parent_clip_rect = ui.clip_rect(); - let inner = Area::new(popup_id) .order(Order::Foreground) .fixed_pos(widget_response.rect.left_bottom()) .show(ui.ctx(), |ui| { - ui.set_clip_rect(parent_clip_rect); // for when the combo-box is in a scroll area. + // Note: we use a separate clip-rect for this area, so the popup can be outside the parent. + // See https://github.com/emilk/egui/issues/825 let frame = Frame::popup(ui.style()); let frame_margin = frame.margin; frame