From a716fce12200470d56a56ebcb6bebc6f420c53e8 Mon Sep 17 00:00:00 2001 From: Cameron <51241057+maniwani@users.noreply.github.com> Date: Tue, 25 Jul 2023 13:35:03 -0700 Subject: [PATCH] more consistent comment spacing --- crates/bevy_winit/src/lib.rs | 23 +++++++++++------------ crates/bevy_winit/src/winit_config.rs | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/crates/bevy_winit/src/lib.rs b/crates/bevy_winit/src/lib.rs index fe2d7cc34acf2..b73b30bcff15b 100644 --- a/crates/bevy_winit/src/lib.rs +++ b/crates/bevy_winit/src/lib.rs @@ -85,13 +85,11 @@ impl Plugin for WinitPlugin { app.init_non_send_resource::() .init_resource::() .set_runner(winit_runner) - // exit_on_all_closed only uses the query to determine if the query is empty, - // and so doesn't care about ordering relative to changed_window .add_systems( Last, ( - // `exit_on_all_closed` seemingly conflicts with `changed_window` - // but does not actually access any data (only checks if the query is empty) + // `exit_on_all_closed` only checks if windows exist but doesn't access data, + // so we don't need to care about its ordering relative to `changed_windows` changed_windows.ambiguous_with(exit_on_all_closed), // apply all changes first, then despawn windows despawn_windows.after(changed_windows), @@ -105,16 +103,16 @@ impl Plugin for WinitPlugin { let event_loop = event_loop_builder.build(); - // iOS, macOS, and Android don't like it if you create windows before the - // event loop is initialized. + // iOS, macOS, and Android don't like it if you create windows before the event loop is + // initialized. // // See: // - https://github.com/rust-windowing/winit/blob/master/README.md#macos // - https://github.com/rust-windowing/winit/blob/master/README.md#ios #[cfg(not(any(target_os = "android", target_os = "ios", target_os = "macos")))] { - // Otherwise, we want to create a window before `bevy_render` initializes - // the renderer so that we have a surface to use as a hint. + // Otherwise, we want to create a window before `bevy_render` initializes the renderer + // so that we have a surface to use as a hint. // This improves compatibility with wgpu backends, especially WASM/WebGL2. let mut create_windows = IntoSystem::into_system(create_windows::<()>); create_windows.initialize(&mut app.world); @@ -242,7 +240,8 @@ unsafe fn transmute_to_static_ref(r: &T) -> &'static T { /// The default [`App::runner`] for the [`WinitPlugin`] plugin. /// -/// Overriding the app's [runner](bevy_app::App::runner) while using `WinitPlugin` will bypass the `EventLoop`. +/// Overriding the app's [runner](bevy_app::App::runner) while using `WinitPlugin` will bypass the +/// `EventLoop`. pub fn winit_runner(mut app: App) { let mut event_loop = app .world @@ -450,9 +449,9 @@ pub fn winit_runner(mut app: App) { let new_factor = window.resolution.scale_factor(); if let Some(forced_factor) = window.resolution.scale_factor_override() { - // This window is overriding the OS-suggested DPI, so its physical - // size should be set based on the overriding value. - // Its logical size already incorporates any resize constraints. + // This window is overriding the OS-suggested DPI, so its physical size + // should be set based on the overriding value. Its logical size already + // incorporates any resize constraints. *new_inner_size = winit::dpi::LogicalSize::new(window.width(), window.height()) .to_physical::(forced_factor); diff --git a/crates/bevy_winit/src/winit_config.rs b/crates/bevy_winit/src/winit_config.rs index 8488a58cec886..e9b4b12a1abaf 100644 --- a/crates/bevy_winit/src/winit_config.rs +++ b/crates/bevy_winit/src/winit_config.rs @@ -11,7 +11,8 @@ pub struct WinitSettings { /// - If this value is set to `true`, [`run_return`] is called, and exiting the loop will /// return control to the caller. /// - /// **NOTE:** This cannot be changed while the loop is running. `winit` discourages use of `run_return`. + /// **NOTE:** This cannot be changed while the loop is running. `winit` discourages use of + /// `run_return`. /// /// # Supported platforms /// @@ -84,16 +85,15 @@ impl Default for WinitSettings { /// Determines how frequently an [`App`](bevy_app::App) should update. /// /// **NOTE:** This setting is independent of VSync. VSync is controlled by a window's -/// [`PresentMode`](bevy_window::PresentMode) setting. If an app can update faster than -/// the refresh rate, but VSync is enabled, the update rate will be indirectly limited -/// by the renderer. +/// [`PresentMode`](bevy_window::PresentMode) setting. If an app can update faster than the refresh +/// rate, but VSync is enabled, the update rate will be indirectly limited by the renderer. #[derive(Debug, Clone, Copy)] pub enum UpdateMode { - /// The [`App`](bevy_app::App) will update over and over, as fast as it possibly can, - /// until an [`AppExit`](bevy_app::AppExit) event appears. + /// The [`App`](bevy_app::App) will update over and over, as fast as it possibly can, until an + /// [`AppExit`](bevy_app::AppExit) event appears. Continuous, - /// The [`App`](bevy_app::App) will update in response to the following, - /// until an [`AppExit`](bevy_app::AppExit) event appears: + /// The [`App`](bevy_app::App) will update in response to the following, until an + /// [`AppExit`](bevy_app::AppExit) event appears: /// - enough time has elapsed since the previous update /// - a redraw is requested /// - new window or device events have appeared @@ -104,8 +104,8 @@ pub enum UpdateMode { /// The [`App`](bevy_app::App) will wait forever if you set this to [`Duration::MAX`]. wait: Duration, }, - /// The [`App`](bevy_app::App) will update in response to the following, - /// until an [`AppExit`](bevy_app::AppExit) event appears: + /// The [`App`](bevy_app::App) will update in response to the following, until an + /// [`AppExit`](bevy_app::AppExit) event appears: /// - enough time has elapsed since the previous update /// - a redraw is requested /// - new window events have appeared