summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-07-04 23:23:36 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-04 23:23:36 +0200
commit8914e945cb6977b28e5f001f5f1e1a3aa2a31d4e (patch)
tree88f896a9a53e5b046aff584e507c59f40d671b49
parente91871aed7f6a1e76961ff616b70582c38088df3 (diff)
downloadserenity-8914e945cb6977b28e5f001f5f1e1a3aa2a31d4e.zip
WebContent: Translate mouse event coordinates into content space
The WebContentView widget now passes content space coordinates along with the various mouse events. :^)
-rw-r--r--Demos/WebView/WebContentView.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Demos/WebView/WebContentView.cpp b/Demos/WebView/WebContentView.cpp
index e48bd64bc2..fcc27a6d12 100644
--- a/Demos/WebView/WebContentView.cpp
+++ b/Demos/WebView/WebContentView.cpp
@@ -66,17 +66,17 @@ void WebContentView::resize_event(GUI::ResizeEvent& event)
void WebContentView::mousedown_event(GUI::MouseEvent& event)
{
- client().post_message(Messages::WebContentServer::MouseDown(event.position(), event.button(), event.buttons(), event.modifiers()));
+ client().post_message(Messages::WebContentServer::MouseDown(to_content_position(event.position()), event.button(), event.buttons(), event.modifiers()));
}
void WebContentView::mouseup_event(GUI::MouseEvent& event)
{
- client().post_message(Messages::WebContentServer::MouseUp(event.position(), event.button(), event.buttons(), event.modifiers()));
+ client().post_message(Messages::WebContentServer::MouseUp(to_content_position(event.position()), event.button(), event.buttons(), event.modifiers()));
}
void WebContentView::mousemove_event(GUI::MouseEvent& event)
{
- client().post_message(Messages::WebContentServer::MouseMove(event.position(), event.button(), event.buttons(), event.modifiers()));
+ client().post_message(Messages::WebContentServer::MouseMove(to_content_position(event.position()), event.button(), event.buttons(), event.modifiers()));
}
void WebContentView::notify_server_did_paint(Badge<WebContentClient>, i32 shbuf_id)