From 5634d637592d38295feffcca31739e38764cdbde Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Thu, 27 Oct 2022 13:31:32 +0100 Subject: [PATCH] Fixed window scale reset bug --- voxygen/src/session/settings_change.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/voxygen/src/session/settings_change.rs b/voxygen/src/session/settings_change.rs index 356580215f..f2778abcbc 100644 --- a/voxygen/src/session/settings_change.rs +++ b/voxygen/src/session/settings_change.rs @@ -412,7 +412,7 @@ impl SettingsChange { } }, SettingsChange::Graphics(graphics_change) => { - let mut change_all = false; + let mut change_preset = false; match graphics_change { Graphics::AdjustTerrainViewDistance(terrain_vd) => { @@ -490,15 +490,23 @@ impl SettingsChange { }, Graphics::ResetGraphicsSettings => { settings.graphics = GraphicsSettings::default(); - change_all = true; + change_preset = true; + // Fullscreen mode + global_state + .window + .set_fullscreen_mode(settings.graphics.fullscreen); + // Window size + global_state + .window + .set_size(settings.graphics.window_size.into()); }, Graphics::ChangeGraphicsSettings(f) => { settings.graphics = f(settings.graphics.clone()); - change_all = true; + change_preset = true; }, } - if change_all { + if change_preset { let graphics = &settings.graphics; // View distance client_set_view_distance(settings, session_state); @@ -521,10 +529,6 @@ impl SettingsChange { .renderer_mut() .set_render_mode(graphics.render_mode.clone()) .unwrap(); - // Fullscreen mode - global_state.window.set_fullscreen_mode(graphics.fullscreen); - // Window size - global_state.window.set_size(graphics.window_size.into()); } }, SettingsChange::Interface(interface_change) => {