From 285b75fe1a0d56484acdb908c65cd6681c05d777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl?= Date: Sat, 9 Mar 2024 18:41:21 +0100 Subject: [PATCH 1/3] Renaming WindowSize to UIWindowSize and correct doc string --- crates/border-wars/src/responsive_scale.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/border-wars/src/responsive_scale.rs b/crates/border-wars/src/responsive_scale.rs index 612f016..45bb874 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 window size. #[derive(Resource)] -pub struct WindowSize(pub Vec2); +pub struct UIWindowSize(pub Vec2); -/// Initializes the window size. +/// Initializes [UIWindowSize]. pub fn init_window_size(mut command: Commands) { - command.insert_resource(WindowSize(Vec2::new(1280., 720.))); + command.insert_resource(UIWindowSize(Vec2::new(1280., 720.))); } -/// Calculates the ui_scale.0 depending on the default screen size +/// Calculates the ui_scale.0 depending on the [UIWindowSize] /// in order to make the screen 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) = ( -- 2.43.4 From 49fd625e97172829284c0715c05b44ab0ece04ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl?= Date: Sat, 9 Mar 2024 18:48:48 +0100 Subject: [PATCH 2/3] Renaming UIWindowSize to UILayoutSize --- crates/border-wars/src/responsive_scale.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/border-wars/src/responsive_scale.rs b/crates/border-wars/src/responsive_scale.rs index 45bb874..83c2c52 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 ui window size. +/// The default ui layout size. #[derive(Resource)] -pub struct UIWindowSize(pub Vec2); +pub struct UILayoutSize(pub Vec2); -/// Initializes [UIWindowSize]. +/// Initializes [UILayoutSize]. pub fn init_window_size(mut command: Commands) { - command.insert_resource(UIWindowSize(Vec2::new(1280., 720.))); + command.insert_resource(UILayoutSize(Vec2::new(1280., 720.))); } -/// Calculates the ui_scale.0 depending on the [UIWindowSize] +/// Calculates the ui_scale.0 depending on the [UILayoutSize] /// in order to make the screen 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) = ( -- 2.43.4 From 55616090d6467b8f08b3c1486d09029b7ec3fcb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl?= Date: Sat, 9 Mar 2024 18:51:51 +0100 Subject: [PATCH 3/3] modifying doc strings --- crates/border-wars/src/responsive_scale.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/border-wars/src/responsive_scale.rs b/crates/border-wars/src/responsive_scale.rs index 83c2c52..dbca623 100644 --- a/crates/border-wars/src/responsive_scale.rs +++ b/crates/border-wars/src/responsive_scale.rs @@ -22,7 +22,7 @@ pub fn init_window_size(mut command: Commands) { } /// Calculates the ui_scale.0 depending on the [UILayoutSize] -/// in order to make the screen responsive. +/// in order to make the ui layout responsive. pub fn change_scaling( mut ui_scale: ResMut, windows: Query<&Window>, -- 2.43.4