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

LibWeb: Avoid copying viewport rect when converting length to pixels

See https://github.com/SerenityOS/serenity/pull/3433#discussion_r484570948
This commit is contained in:
networkException 2022-09-10 12:43:05 +02:00 committed by Linus Groh
parent be41b19146
commit 9ff6c1e692

View file

@ -104,7 +104,7 @@ float Length::to_px(Layout::Node const& layout_node) const
if (!layout_node.document().browsing_context())
return 0;
auto viewport_rect = layout_node.document().browsing_context()->viewport_rect();
auto const& viewport_rect = layout_node.document().browsing_context()->viewport_rect();
auto* root_element = layout_node.document().document_element();
if (!root_element || !root_element->layout_node())
return 0;