Skip to content

Commit

Permalink
simplify is_init logic
Browse files Browse the repository at this point in the history
  • Loading branch information
msparkles committed Jul 3, 2024
1 parent 939f78c commit 076e91b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions crates/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,7 @@ impl<T: ExampleBody> ApplicationHandler for App<T> {

fn new_events(&mut self, _event_loop: &ActiveEventLoop, cause: winit::event::StartCause) {
if let Some(app) = self.app.as_mut() {
if cause == StartCause::Init {
app.is_init = true;
} else {
app.is_init = false;
}
app.is_init = cause == StartCause::Init;
}
}

Expand Down
6 changes: 1 addition & 5 deletions crates/demo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
}

Event::NewEvents(cause) => {
if cause == StartCause::Init {
graphics.is_init = true;
} else {
graphics.is_init = false;
}
graphics.is_init = cause == StartCause::Init;
}

Event::WindowEvent {
Expand Down

0 comments on commit 076e91b

Please sign in to comment.