fix: window size saving

This commit is contained in:
ardocrat 2024-10-26 23:54:47 +03:00
parent ebd09ab1c8
commit f6fbf7226e

View file

@ -88,10 +88,9 @@ impl<Platform: PlatformCallbacks> App<Platform> {
ctx.send_viewport_cmd(ViewportCommand::CancelClose); ctx.send_viewport_cmd(ViewportCommand::CancelClose);
Content::show_exit_modal(); Content::show_exit_modal();
} else { } else {
let (w, h) = View::window_size(ctx);
AppConfig::save_window_size(w, h);
ctx.input(|i| { ctx.input(|i| {
if let Some(rect) = i.viewport().inner_rect {
AppConfig::save_window_size(rect.width(), rect.height());
}
if let Some(rect) = i.viewport().outer_rect { if let Some(rect) = i.viewport().outer_rect {
AppConfig::save_window_pos(rect.left(), rect.top()); AppConfig::save_window_pos(rect.left(), rect.top());
} }