adding an expect to the get_single() method
Some checks failed
Rust Checks / checks (push) Failing after 7s
Rust Checks / checks (pull_request) Failing after 4s

This commit is contained in:
Raphaël 2024-03-09 15:01:13 +01:00
parent 11e4aef80d
commit 31bebd6542

View file

@ -10,8 +10,8 @@ const DEFAULT_HEIGHT: f32 = 720.;
/// Calculates the ui_scale.0 depending on the default screen size
/// in order to make the screen responsive
pub fn change_scaling(mut ui_scale: ResMut<UiScale>, window: Query<&Window>) {
let window = window.single();
pub fn change_scaling(mut ui_scale: ResMut<UiScale>, windows: Query<&Window>) {
let window = windows.get_single().expect("Main window not found");
let (a, b) = (
window.resolution.width() / DEFAULT_WIDTH,
window.resolution.height() / DEFAULT_HEIGHT,