Skip to content

Commit

Permalink
make modal dialogs always show up in the middle
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Dec 19, 2023
1 parent 3e8a3ad commit d9bef9d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/re_ui/src/modal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ impl Modal {
let mut open = ui.input(|i| !i.key_pressed(egui::Key::Escape));

let mut window = egui::Window::new(&self.title)
// TODO(andreas): Doesn't center properly. `pivot(Align2::CENTER_CENTER)` seems to be
// broken. Also, should reset every time
.default_pos(ui.ctx().screen_rect().center())
.pivot(egui::Align2::CENTER_CENTER)
.fixed_pos(ui.ctx().screen_rect().center())
.collapsible(false)
.resizable(true)
.frame(egui::Frame {
Expand Down

0 comments on commit d9bef9d

Please sign in to comment.