Skip to content

Commit

Permalink
fmt and clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazariglez committed Jan 30, 2024
1 parent 36d6c3e commit cec247e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion crates/notan_winit/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ impl BackendSystem for WinitBackend {
_ => {}
}


*control_flow = {
let b = backend(&mut app.backend);
let exit_requested = b.exit_requested;
Expand Down
8 changes: 4 additions & 4 deletions crates/notan_winit/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct WinitWindowBackend {
mouse_passthrough: bool,
title: String,
use_touch_as_mouse: bool,
pub(crate) frame_requested: bool
pub(crate) frame_requested: bool,
}

impl WindowBackend for WinitWindowBackend {
Expand Down Expand Up @@ -309,14 +309,14 @@ impl WinitWindowBackend {
}

if let Some((x, y)) = config.position {
let safe_x = x;
let safe_y = y;
#[cfg(not(windows))]
let (safe_x, safe_y) = (x, y);

// This is already done by the OS in Linux/MacOS
#[cfg(windows)]
let (safe_x, safe_y) = {
let clamped_position =
clamp_window_to_sane_position(config.width, config.height, x, y, &event_loop);
clamp_window_to_sane_position(config.width, config.height, x, y, event_loop);

(clamped_position.0, clamped_position.1)
};
Expand Down

0 comments on commit cec247e

Please sign in to comment.