diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-11-02 17:35:53 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-12-10 12:03:19 +0000 |
commit | 3c7bd5a317515ac572610eba2919c82dcd320a1e (patch) | |
tree | e716f6049c9bd58ba9f07c8d9fa9aaa42f23a39f /Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp | |
parent | 045aa8530c56b9a58f5e9150f17cb08e29bf5ab2 (diff) | |
download | serenity-3c7bd5a317515ac572610eba2919c82dcd320a1e.zip |
LibWeb+WebContent+headless-browser: Use CSSPixels for PageClient events
...and also for hit testing, which is involved in most of them.
Much of this is temporary conversions and other awkwardness, which
should resolve itself as the rest of LibWeb is converted to these new
types. Hopefully. :thousandyakstare:
Diffstat (limited to 'Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp b/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp index 358956e780..ebedfdf967 100644 --- a/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp @@ -35,7 +35,7 @@ Layout::FormAssociatedLabelableNode& LabelablePaintable::layout_box() return static_cast<Layout::FormAssociatedLabelableNode&>(PaintableBox::layout_box()); } -LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned) +LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousedown(Badge<EventHandler>, CSSPixelPoint, unsigned button, unsigned) { if (button != GUI::MouseButton::Primary || !layout_box().dom_node().enabled()) return DispatchEventOfSameName::No; @@ -46,12 +46,12 @@ LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousedown return DispatchEventOfSameName::Yes; } -LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint position, unsigned button, unsigned) +LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mouseup(Badge<EventHandler>, CSSPixelPoint position, unsigned button, unsigned) { if (!m_tracking_mouse || button != GUI::MouseButton::Primary || !layout_box().dom_node().enabled()) return DispatchEventOfSameName::No; - bool is_inside_node_or_label = enclosing_int_rect(absolute_rect()).contains(position); + bool is_inside_node_or_label = absolute_rect().to_type<CSSPixels>().contains(position); if (!is_inside_node_or_label) is_inside_node_or_label = Layout::Label::is_inside_associated_label(layout_box(), position); @@ -61,12 +61,12 @@ LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mouseup(B return DispatchEventOfSameName::Yes; } -LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint position, unsigned, unsigned) +LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousemove(Badge<EventHandler>, CSSPixelPoint position, unsigned, unsigned) { if (!m_tracking_mouse || !layout_box().dom_node().enabled()) return DispatchEventOfSameName::No; - bool is_inside_node_or_label = enclosing_int_rect(absolute_rect()).contains(position); + bool is_inside_node_or_label = absolute_rect().to_type<CSSPixels>().contains(position); if (!is_inside_node_or_label) is_inside_node_or_label = Layout::Label::is_inside_associated_label(layout_box(), position); |