From 6d466c65a440324e0f362d7ca8ad4a856fdf977b Mon Sep 17 00:00:00 2001 From: Mona Mayrhofer Date: Tue, 3 Mar 2026 17:50:31 +0100 Subject: [PATCH] mouse speed multiplier --- crates/cursor-move-webapp/src/components/mouse_area.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/cursor-move-webapp/src/components/mouse_area.rs b/crates/cursor-move-webapp/src/components/mouse_area.rs index e684f41..642d339 100644 --- a/crates/cursor-move-webapp/src/components/mouse_area.rs +++ b/crates/cursor-move-webapp/src/components/mouse_area.rs @@ -20,6 +20,8 @@ const FLING_START_THRESHOLD_VELOCITY: f64 = 500.0; const FLING_STOP_THRESHOLD_VELOCITY: f64 = 100.0; const FLING_DAMPENING: f64 = 0.98; +const CURSOR_SPEED_MULTIPLIER: f64 = 1.5; + pub struct PointerRegistryData { initial_position: Point2D, @@ -61,8 +63,8 @@ pub fn MouseArea(onevent: EventHandler) -> Element { if registry.pointers.len() == 1 { onevent.call(ClientEvent::MouseMove { - dx: delta.x, - dy: delta.y, + dx: delta.x * CURSOR_SPEED_MULTIPLIER, + dy: delta.y * CURSOR_SPEED_MULTIPLIER, }); } else if registry.pointers.len() == 2 { onevent.call(ClientEvent::MouseScroll { @@ -145,8 +147,8 @@ pub fn MouseArea(onevent: EventHandler) -> Element { None } else { onevent.call(ClientEvent::MouseMove { - dx: flinger.velocity.x * delta_seconds, - dy: flinger.velocity.y * delta_seconds, + dx: flinger.velocity.x * delta_seconds * CURSOR_SPEED_MULTIPLIER, + dy: flinger.velocity.y * delta_seconds * CURSOR_SPEED_MULTIPLIER, }); //tracing::info!("Fling: {:?}", flinger.velocity);