Skip to content

Commit a716fce

Browse files
committed
more consistent comment spacing
1 parent b0e9a30 commit a716fce

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

crates/bevy_winit/src/lib.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,11 @@ impl Plugin for WinitPlugin {
8585
app.init_non_send_resource::<WinitWindows>()
8686
.init_resource::<WinitSettings>()
8787
.set_runner(winit_runner)
88-
// exit_on_all_closed only uses the query to determine if the query is empty,
89-
// and so doesn't care about ordering relative to changed_window
9088
.add_systems(
9189
Last,
9290
(
93-
// `exit_on_all_closed` seemingly conflicts with `changed_window`
94-
// but does not actually access any data (only checks if the query is empty)
91+
// `exit_on_all_closed` only checks if windows exist but doesn't access data,
92+
// so we don't need to care about its ordering relative to `changed_windows`
9593
changed_windows.ambiguous_with(exit_on_all_closed),
9694
// apply all changes first, then despawn windows
9795
despawn_windows.after(changed_windows),
@@ -105,16 +103,16 @@ impl Plugin for WinitPlugin {
105103

106104
let event_loop = event_loop_builder.build();
107105

108-
// iOS, macOS, and Android don't like it if you create windows before the
109-
// event loop is initialized.
106+
// iOS, macOS, and Android don't like it if you create windows before the event loop is
107+
// initialized.
110108
//
111109
// See:
112110
// - https://github.com/rust-windowing/winit/blob/master/README.md#macos
113111
// - https://github.com/rust-windowing/winit/blob/master/README.md#ios
114112
#[cfg(not(any(target_os = "android", target_os = "ios", target_os = "macos")))]
115113
{
116-
// Otherwise, we want to create a window before `bevy_render` initializes
117-
// the renderer so that we have a surface to use as a hint.
114+
// Otherwise, we want to create a window before `bevy_render` initializes the renderer
115+
// so that we have a surface to use as a hint.
118116
// This improves compatibility with wgpu backends, especially WASM/WebGL2.
119117
let mut create_windows = IntoSystem::into_system(create_windows::<()>);
120118
create_windows.initialize(&mut app.world);
@@ -242,7 +240,8 @@ unsafe fn transmute_to_static_ref<T>(r: &T) -> &'static T {
242240

243241
/// The default [`App::runner`] for the [`WinitPlugin`] plugin.
244242
///
245-
/// Overriding the app's [runner](bevy_app::App::runner) while using `WinitPlugin` will bypass the `EventLoop`.
243+
/// Overriding the app's [runner](bevy_app::App::runner) while using `WinitPlugin` will bypass the
244+
/// `EventLoop`.
246245
pub fn winit_runner(mut app: App) {
247246
let mut event_loop = app
248247
.world
@@ -450,9 +449,9 @@ pub fn winit_runner(mut app: App) {
450449
let new_factor = window.resolution.scale_factor();
451450

452451
if let Some(forced_factor) = window.resolution.scale_factor_override() {
453-
// This window is overriding the OS-suggested DPI, so its physical
454-
// size should be set based on the overriding value.
455-
// Its logical size already incorporates any resize constraints.
452+
// This window is overriding the OS-suggested DPI, so its physical size
453+
// should be set based on the overriding value. Its logical size already
454+
// incorporates any resize constraints.
456455
*new_inner_size =
457456
winit::dpi::LogicalSize::new(window.width(), window.height())
458457
.to_physical::<u32>(forced_factor);

crates/bevy_winit/src/winit_config.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ pub struct WinitSettings {
1111
/// - If this value is set to `true`, [`run_return`] is called, and exiting the loop will
1212
/// return control to the caller.
1313
///
14-
/// **NOTE:** This cannot be changed while the loop is running. `winit` discourages use of `run_return`.
14+
/// **NOTE:** This cannot be changed while the loop is running. `winit` discourages use of
15+
/// `run_return`.
1516
///
1617
/// # Supported platforms
1718
///
@@ -84,16 +85,15 @@ impl Default for WinitSettings {
8485
/// Determines how frequently an [`App`](bevy_app::App) should update.
8586
///
8687
/// **NOTE:** This setting is independent of VSync. VSync is controlled by a window's
87-
/// [`PresentMode`](bevy_window::PresentMode) setting. If an app can update faster than
88-
/// the refresh rate, but VSync is enabled, the update rate will be indirectly limited
89-
/// by the renderer.
88+
/// [`PresentMode`](bevy_window::PresentMode) setting. If an app can update faster than the refresh
89+
/// rate, but VSync is enabled, the update rate will be indirectly limited by the renderer.
9090
#[derive(Debug, Clone, Copy)]
9191
pub enum UpdateMode {
92-
/// The [`App`](bevy_app::App) will update over and over, as fast as it possibly can,
93-
/// until an [`AppExit`](bevy_app::AppExit) event appears.
92+
/// The [`App`](bevy_app::App) will update over and over, as fast as it possibly can, until an
93+
/// [`AppExit`](bevy_app::AppExit) event appears.
9494
Continuous,
95-
/// The [`App`](bevy_app::App) will update in response to the following,
96-
/// until an [`AppExit`](bevy_app::AppExit) event appears:
95+
/// The [`App`](bevy_app::App) will update in response to the following, until an
96+
/// [`AppExit`](bevy_app::AppExit) event appears:
9797
/// - enough time has elapsed since the previous update
9898
/// - a redraw is requested
9999
/// - new window or device events have appeared
@@ -104,8 +104,8 @@ pub enum UpdateMode {
104104
/// The [`App`](bevy_app::App) will wait forever if you set this to [`Duration::MAX`].
105105
wait: Duration,
106106
},
107-
/// The [`App`](bevy_app::App) will update in response to the following,
108-
/// until an [`AppExit`](bevy_app::AppExit) event appears:
107+
/// The [`App`](bevy_app::App) will update in response to the following, until an
108+
/// [`AppExit`](bevy_app::AppExit) event appears:
109109
/// - enough time has elapsed since the previous update
110110
/// - a redraw is requested
111111
/// - new window events have appeared

0 commit comments

Comments
 (0)