mouse speed multiplier

This commit is contained in:
Mona Mayrhofer 2026-03-03 17:50:31 +01:00
parent d0a458b450
commit 6d466c65a4
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 374AB152BDEBA1AE

View file

@ -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<f64, ElementSpace>,
@ -61,8 +63,8 @@ pub fn MouseArea(onevent: EventHandler<ClientEvent>) -> 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<ClientEvent>) -> 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);