From d0c33523ce4ef6aeb9ec1c5068ce2adfd8769e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl?= Date: Sat, 9 Mar 2024 17:53:32 +0000 Subject: [PATCH] Renaming WindowSize (#77) Reviewed-on: https://git.tipragot.fr/fish-canard/border-wars/pulls/77 Reviewed-by: Tipragot --- crates/border-wars/src/responsive_scale.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/border-wars/src/responsive_scale.rs b/crates/border-wars/src/responsive_scale.rs index 612f016..dbca623 100644 --- a/crates/border-wars/src/responsive_scale.rs +++ b/crates/border-wars/src/responsive_scale.rs @@ -12,21 +12,21 @@ impl Plugin for ResponsiveScalingPlugin { } } -/// The default window size. +/// The default ui layout size. #[derive(Resource)] -pub struct WindowSize(pub Vec2); +pub struct UILayoutSize(pub Vec2); -/// Initializes the window size. +/// Initializes [UILayoutSize]. pub fn init_window_size(mut command: Commands) { - command.insert_resource(WindowSize(Vec2::new(1280., 720.))); + command.insert_resource(UILayoutSize(Vec2::new(1280., 720.))); } -/// Calculates the ui_scale.0 depending on the default screen size -/// in order to make the screen responsive. +/// Calculates the ui_scale.0 depending on the [UILayoutSize] +/// in order to make the ui layout responsive. pub fn change_scaling( mut ui_scale: ResMut, windows: Query<&Window>, - size: Res, + size: Res, ) { let window = windows.get_single().expect("Main window not found"); let (a, b) = (