Avoid egui feature unsupported on wayland
This commit is contained in:
parent
1cae0c8e54
commit
a87fce102d
|
@ -142,8 +142,7 @@ impl GameWindow {
|
|||
fn show_options_menu(&mut self, ctx: &Context, ui: &mut Ui) {
|
||||
ui.menu_button("Video", |ui| {
|
||||
ui.menu_button("Screen Size", |ui| {
|
||||
let current_dims = ctx.input(|i| i.viewport().inner_rect.unwrap());
|
||||
let current_dims = current_dims.max - current_dims.min;
|
||||
let current_dims = self.config.dimensions;
|
||||
|
||||
for scale in 1..=4 {
|
||||
let label = format!("x{scale}");
|
||||
|
@ -183,10 +182,7 @@ impl GameWindow {
|
|||
return;
|
||||
}
|
||||
|
||||
let current_dims = {
|
||||
let viewport = ctx.input(|i| i.viewport().inner_rect.unwrap());
|
||||
viewport.max - viewport.min
|
||||
};
|
||||
let current_dims = self.config.dimensions;
|
||||
let new_proportions = display_mode.proportions();
|
||||
let scale = new_proportions / old_proportions;
|
||||
if scale != Vec2::new(1.0, 1.0) {
|
||||
|
@ -330,7 +326,7 @@ impl AppWindow for GameWindow {
|
|||
|
||||
fn show(&mut self, ctx: &Context) {
|
||||
let dimensions = {
|
||||
let bounds = ctx.input(|i| i.viewport().inner_rect.unwrap());
|
||||
let bounds = ctx.available_rect();
|
||||
bounds.max - bounds.min
|
||||
};
|
||||
self.update_config(|c| c.dimensions = dimensions);
|
||||
|
|
Loading…
Reference in New Issue