1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28: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:
Sam Atkins 2021-09-08 11:22:44 +01:00 committed by Linus Groh
parent 92a3318375
commit a09219159c
9 changed files with 13 additions and 12 deletions

View file

@ -68,9 +68,9 @@ void WebContentClient::did_change_title(String const& title)
m_view.notify_server_did_change_title({}, title);
}
void WebContentClient::did_request_scroll(int wheel_delta)
void WebContentClient::did_request_scroll(i32 x_delta, i32 y_delta)
{
m_view.notify_server_did_request_scroll({}, wheel_delta);
m_view.notify_server_did_request_scroll({}, x_delta, y_delta);
}
void WebContentClient::did_request_scroll_into_view(Gfx::IntRect const& rect)