mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09:00
LibWeb: Make handle_mousewheel wheel delta use pixels
This commit is contained in:
parent
7d588db6c8
commit
0facfd3257
Notes:
sideshowbarker
2024-07-17 08:43:11 +09:00
Author: https://github.com/bplaat
Commit: 0facfd3257
Pull-request: https://github.com/SerenityOS/serenity/pull/20460
Reviewed-by: https://github.com/MacDue
Reviewed-by: https://github.com/kalenikaliaksandr
3 changed files with 9 additions and 8 deletions
|
@ -423,9 +423,12 @@ void OutOfProcessWebView::process_next_input_event()
|
|||
case GUI::Event::Type::MouseMove:
|
||||
client().async_mouse_move(to_content_position(event.position()), event.button(), event.buttons(), event.modifiers());
|
||||
break;
|
||||
case GUI::Event::Type::MouseWheel:
|
||||
client().async_mouse_wheel(to_content_position(event.position()), event.button(), event.buttons(), event.modifiers(), event.wheel_delta_x(), event.wheel_delta_y());
|
||||
case GUI::Event::Type::MouseWheel: {
|
||||
// FIXME: This wheel delta step size multiplier is used to remain the old scroll behaviour, in future use system step size.
|
||||
constexpr int scroll_step_size = 24;
|
||||
client().async_mouse_wheel(to_content_position(event.position()), event.button(), event.buttons(), event.modifiers(), event.wheel_delta_x() * scroll_step_size, event.wheel_delta_y() * scroll_step_size);
|
||||
break;
|
||||
}
|
||||
case GUI::Event::Type::MouseDoubleClick:
|
||||
client().async_doubleclick(to_content_position(event.position()), event.button(), event.buttons(), event.modifiers());
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue