summaryrefslogtreecommitdiff
path: root/engine/src/windowing/mouse.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-07-12 16:56:31 +0200
committerHampusM <hampus@hampusmat.com>2026-07-13 13:25:24 +0200
commitce2c05217251a6b87c20956889bf84953000f096 (patch)
tree10daa693d84ee98816f3e2558046f57c1c012d8a /engine/src/windowing/mouse.rs
parent453247306d66f008e12961323d4beea8c219deca (diff)
feat(engine): add scroll delta to Mouse
Diffstat (limited to 'engine/src/windowing/mouse.rs')
-rw-r--r--engine/src/windowing/mouse.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/engine/src/windowing/mouse.rs b/engine/src/windowing/mouse.rs
index 649036a..abe2ab7 100644
--- a/engine/src/windowing/mouse.rs
+++ b/engine/src/windowing/mouse.rs
@@ -17,6 +17,23 @@ pub struct Mouse
/// Coordinates in pixels relative to the top-left corner of the window. May have
/// been affected by cursor acceleration
pub position: PhysicalPosition<f64>,
+
+ pub scroll_delta: ScrollDelta,
+}
+
+#[derive(Debug, Clone, Default)]
+pub struct ScrollDelta
+{
+ pub vert_lines: f32,
+ pub hor_lines: f32,
+}
+
+impl ScrollDelta
+{
+ pub fn is_zero(&self) -> bool
+ {
+ self.vert_lines == 0.0 && self.hor_lines == 0.0
+ }
}
/// Mouse buttons.