ui: window resize

This commit is contained in:
ardocrat
2024-07-01 22:08:45 +03:00
parent dafd2a1db3
commit 8b0bb2b771
2 changed files with 5 additions and 18 deletions
+2 -9
View File
@@ -83,15 +83,8 @@ impl View {
/// Get width and height of app window.
pub fn window_size(ui: &egui::Ui) -> (f32, f32) {
ui.ctx().input(|i| {
return match i.viewport().inner_rect {
None => {
let rect = i.screen_rect;
(rect.width(), rect.height())
},
Some(rect) => (rect.width(), rect.height())
};
})
let rect = ui.ctx().screen_rect();
(rect.width(), rect.height())
}
/// Callback on Enter key press event.