mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Implement VisualViewport aware viewport scrolling
Implements spec algorithm for viewport scrolling that first checks if it's possible to use delta to move the visual viewport before falling back to scrolling the layout viewport. This is a part of pinch-to-zoom support.
This commit is contained in:
parent
7ba34e8bd1
commit
b477c6bfc4
Notes:
github-actions[bot]
2025-10-10 13:39:33 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: b477c6bfc4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6430
Reviewed-by: https://github.com/gmta
Reviewed-by: https://github.com/konradekk
5 changed files with 82 additions and 19 deletions
|
|
@ -438,7 +438,7 @@ EventResult EventHandler::handle_mousewheel(CSSPixelPoint viewport_position, CSS
|
|||
auto page_offset = compute_mouse_event_page_offset(viewport_position);
|
||||
auto offset = compute_mouse_event_offset(page_offset, *layout_node->first_paintable());
|
||||
if (node->dispatch_event(UIEvents::WheelEvent::create_from_platform_event(node->realm(), m_navigable->active_window_proxy(), UIEvents::EventNames::wheel, screen_position, page_offset, viewport_position, offset, wheel_delta_x, wheel_delta_y, button, buttons, modifiers).release_value_but_fixme_should_propagate_errors())) {
|
||||
m_navigable->active_window()->scroll_by(wheel_delta_x, wheel_delta_y);
|
||||
m_navigable->scroll_viewport_by_delta({ wheel_delta_x, wheel_delta_y });
|
||||
}
|
||||
|
||||
handled_event = EventResult::Handled;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue