Skip to content

Commit

Permalink
fix: Emit mouseleave when cursor leaves the window (#497)
Browse files Browse the repository at this point in the history
* fix: Incorrect behavior of use_animation_transition

* fix: Emit mouseleave when cursor leaves the window
  • Loading branch information
marc2332 authored Feb 8, 2024
1 parent 39d0e95 commit e4977d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/renderer/src/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,15 @@ pub fn run_event_loop<State: Clone>(
modifiers: map_winit_modifiers(modifiers_state),
})
}
WindowEvent::CursorLeft { .. } => {
cursor_pos = CursorPoint::new(-1.0, -1.0);

app.send_event(FreyaEvent::Mouse {
name: "mouseover".to_string(),
cursor: cursor_pos,
button: None,
});
}
WindowEvent::CursorMoved { position, .. } => {
cursor_pos = CursorPoint::from((position.x, position.y));

Expand Down

0 comments on commit e4977d3

Please sign in to comment.