generated from tipragot/rust
Fix crashes due to Responsive scaling (#91)
Some checks failed
Rust Checks / checks (push) Failing after 3m9s
Some checks failed
Rust Checks / checks (push) Failing after 3m9s
Co-authored-by: raphael <Aude11..> Reviewed-on: fish-canard/border-wars#91 Reviewed-by: Tipragot <contact@tipragot.fr> Reviewed-by: CoCo_Sol <solois.corentin@gmail.com>
This commit is contained in:
parent
a8895963bf
commit
ceca7d3681
|
@ -29,6 +29,9 @@ pub fn change_scaling(
|
||||||
size: Res<UILayoutSize>,
|
size: Res<UILayoutSize>,
|
||||||
) {
|
) {
|
||||||
let window = windows.get_single().expect("Main window not found");
|
let window = windows.get_single().expect("Main window not found");
|
||||||
|
if window.resolution.physical_height() <= 0 {
|
||||||
|
return;
|
||||||
|
};
|
||||||
let (a, b) = (
|
let (a, b) = (
|
||||||
window.resolution.width() / size.0.x,
|
window.resolution.width() / size.0.x,
|
||||||
window.resolution.height() / size.0.y,
|
window.resolution.height() / size.0.y,
|
||||||
|
|
Loading…
Reference in a new issue