mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
Userland: Add horizontal mouse scroll support
This commit is contained in:
parent
d61cc47055
commit
1662213737
Notes:
sideshowbarker
2024-07-17 20:34:50 +09:00
Author: https://github.com/can3p
Commit: 1662213737
Pull-request: https://github.com/SerenityOS/serenity/pull/11246
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
43 changed files with 112 additions and 84 deletions
|
@ -494,13 +494,13 @@ void Node::handle_mousemove(Badge<EventHandler>, const Gfx::IntPoint&, unsigned,
|
|||
{
|
||||
}
|
||||
|
||||
bool Node::handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&, unsigned, unsigned, int wheel_delta)
|
||||
bool Node::handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y)
|
||||
{
|
||||
if (auto* containing_block = this->containing_block()) {
|
||||
if (!containing_block->is_scrollable())
|
||||
return false;
|
||||
auto new_offset = containing_block->scroll_offset();
|
||||
new_offset.translate_by(0, wheel_delta);
|
||||
new_offset.translate_by(wheel_delta_x, wheel_delta_y);
|
||||
containing_block->set_scroll_offset(new_offset);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue