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

LibWeb: Move box_type_agnostic_position() from layout node to paintable

For this method, there is no need to go through the layout node when we
can directly reach the paintable.
This commit is contained in:
Aliaksandr Kalenik 2024-01-14 11:14:20 +01:00 committed by Andreas Kling
parent 31e5b5f5de
commit 814bed33b4
8 changed files with 39 additions and 36 deletions

View file

@ -116,7 +116,7 @@ static Gfx::StandardCursor cursor_css_to_gfx(Optional<CSS::Cursor> cursor)
static CSSPixelPoint compute_mouse_event_offset(CSSPixelPoint position, Layout::Node const& layout_node)
{
auto top_left_of_layout_node = layout_node.box_type_agnostic_position();
auto top_left_of_layout_node = layout_node.paintable()->box_type_agnostic_position();
return {
position.x() - top_left_of_layout_node.x(),
position.y() - top_left_of_layout_node.y()