mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:08:10 +00:00
LibWeb+WebContent: Modify did_request_scroll() IPC to take x&y deltas
This is in preparation for implementing JS scrolling functions, which specify both x and y scrolling deltas. The visible behavior has not changed. Also, moved the "mouse wheel delta * 20" calculation to the `EventHandler` since the JS calls will want to work directly in pixels.
This commit is contained in:
parent
92a3318375
commit
a09219159c
9 changed files with 13 additions and 12 deletions
|
@ -235,9 +235,10 @@ void OutOfProcessWebView::notify_server_did_change_title(Badge<WebContentClient>
|
|||
on_title_change(title);
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_request_scroll(Badge<WebContentClient>, int wheel_delta)
|
||||
void OutOfProcessWebView::notify_server_did_request_scroll(Badge<WebContentClient>, i32 x_delta, i32 y_delta)
|
||||
{
|
||||
vertical_scrollbar().set_value(vertical_scrollbar().value() + wheel_delta * 20);
|
||||
horizontal_scrollbar().set_value(horizontal_scrollbar().value() + x_delta);
|
||||
vertical_scrollbar().set_value(vertical_scrollbar().value() + y_delta);
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_request_scroll_into_view(Badge<WebContentClient>, const Gfx::IntRect& rect)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue