mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:27:35 +00:00
Ladybird+LibWeb: Add MouseEvent screenX and screenY support
This commit is contained in:
parent
e584189b8f
commit
836a7b00dd
19 changed files with 125 additions and 103 deletions
|
@ -63,9 +63,11 @@ JS::NonnullGCPtr<MouseEvent> MouseEvent::create(JS::Realm& realm, FlyString cons
|
|||
return realm.heap().allocate<MouseEvent>(realm, realm, event_name, event_init, page_x, page_y, offset_x, offset_y);
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<MouseEvent>> MouseEvent::create_from_platform_event(JS::Realm& realm, FlyString const& event_name, CSSPixelPoint page, CSSPixelPoint client, CSSPixelPoint offset, Optional<CSSPixelPoint> movement, unsigned button, unsigned buttons)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<MouseEvent>> MouseEvent::create_from_platform_event(JS::Realm& realm, FlyString const& event_name, CSSPixelPoint screen, CSSPixelPoint page, CSSPixelPoint client, CSSPixelPoint offset, Optional<CSSPixelPoint> movement, unsigned button, unsigned buttons)
|
||||
{
|
||||
MouseEventInit event_init {};
|
||||
event_init.screen_x = screen.x().to_double();
|
||||
event_init.screen_y = screen.y().to_double();
|
||||
event_init.client_x = client.x().to_double();
|
||||
event_init.client_y = client.y().to_double();
|
||||
if (movement.has_value()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue