1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

LibWeb: Convert Paintable coordinates to new pixel units

This fixes a few sizing issues too. The page size is now correct in most
cases! \o/

We get to remove some of the `to_type<>()` shenanigans, though it
reappears in some other places.
This commit is contained in:
Sam Atkins 2022-10-31 19:46:55 +00:00 committed by Linus Groh
parent 57a69f15ff
commit ab49dbf137
39 changed files with 200 additions and 179 deletions

View file

@ -51,7 +51,7 @@ LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mouseup(B
if (!m_tracking_mouse || button != GUI::MouseButton::Primary || !layout_box().dom_node().enabled())
return DispatchEventOfSameName::No;
bool is_inside_node_or_label = absolute_rect().to_type<CSSPixels>().contains(position);
bool is_inside_node_or_label = absolute_rect().contains(position);
if (!is_inside_node_or_label)
is_inside_node_or_label = Layout::Label::is_inside_associated_label(layout_box(), position);
@ -66,7 +66,7 @@ LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousemove
if (!m_tracking_mouse || !layout_box().dom_node().enabled())
return DispatchEventOfSameName::No;
bool is_inside_node_or_label = absolute_rect().to_type<CSSPixels>().contains(position);
bool is_inside_node_or_label = absolute_rect().contains(position);
if (!is_inside_node_or_label)
is_inside_node_or_label = Layout::Label::is_inside_associated_label(layout_box(), position);