Skip to content

Commit

Permalink
better comment egui/src/data/input.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
  • Loading branch information
enomado and emilk authored May 11, 2022
1 parent 8ffe94c commit 6920558
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions egui/src/data/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,12 @@ pub enum Event {
/// The mouse or touch moved to a new place.
PointerMoved(Pos2),

/// The mouse delta from winit::DeviceEvent. MouseDelta and PointerMoved can be emmited simultaneously.
/// If MouseDelta accumulated value is zero per frame, then `old_pos-new_pos` will be used as fallback.
/// For now it used in situations when we need delta but mouse pointer is on screen edge.
/// Mouse movement in unspecified units.
///
/// Both [`Self::MouseDelta`] and [`Self::PointerMoved`] can both be emitted for the same movement,
/// but when a pointer is grabbed or at the edge of the screen, only [`Self::MouseDelta`] is emitted.
///
/// Some integrations do not emit any [`Self::MouseDelta`]. In these cases the change in [`Self::PointerMoved`] will be used for [`PointerState::delta`].
MouseDelta(Vec2),

/// A mouse button was pressed or released (or a touch started or stopped).
Expand Down

0 comments on commit 6920558

Please sign in to comment.