From ceca7d3681ed32d6160c702d8b25227db52d4c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl?= Date: Sun, 31 Mar 2024 16:27:30 +0000 Subject: [PATCH] Fix crashes due to Responsive scaling (#91) Co-authored-by: raphael Reviewed-on: https://git.tipragot.fr/fish-canard/border-wars/pulls/91 Reviewed-by: Tipragot Reviewed-by: CoCo_Sol --- crates/border-wars/src/responsive_scale.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/border-wars/src/responsive_scale.rs b/crates/border-wars/src/responsive_scale.rs index dbca623..f35f335 100644 --- a/crates/border-wars/src/responsive_scale.rs +++ b/crates/border-wars/src/responsive_scale.rs @@ -29,6 +29,9 @@ pub fn change_scaling( size: Res, ) { let window = windows.get_single().expect("Main window not found"); + if window.resolution.physical_height() <= 0 { + return; + }; let (a, b) = ( window.resolution.width() / size.0.x, window.resolution.height() / size.0.y,