From 69205589e3094555d95b4d3da384688616cbc3fa Mon Sep 17 00:00:00 2001 From: Stanislav Date: Wed, 11 May 2022 23:46:14 +0300 Subject: [PATCH] better comment egui/src/data/input.rs Co-authored-by: Emil Ernerfeldt --- egui/src/data/input.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/egui/src/data/input.rs b/egui/src/data/input.rs index b1ffcc26e3b0..cf44af68fc76 100644 --- a/egui/src/data/input.rs +++ b/egui/src/data/input.rs @@ -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).