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