mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-08-06 03:08:42 +02:00
fix: better scroll handling
This commit is contained in:
@@ -795,17 +795,16 @@ impl SynchronizerManager {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"wheel" => Some((
|
"wheel" => {
|
||||||
"Input.dispatchMouseEvent",
|
let dx = -event.delta_x.unwrap_or(0.0);
|
||||||
serde_json::json!({
|
let dy = -event.delta_y.unwrap_or(0.0);
|
||||||
"type": "mouseWheel",
|
Some((
|
||||||
"x": event.x.unwrap_or(0.0),
|
"Runtime.evaluate",
|
||||||
"y": event.y.unwrap_or(0.0),
|
serde_json::json!({
|
||||||
"deltaX": -event.delta_x.unwrap_or(0.0),
|
"expression": format!("window.scrollBy({dx},{dy})"),
|
||||||
"deltaY": -event.delta_y.unwrap_or(0.0),
|
}),
|
||||||
"modifiers": event.modifiers.unwrap_or(0),
|
))
|
||||||
}),
|
}
|
||||||
)),
|
|
||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user