1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:28:11 +00:00

LibWeb: Replace all px Length creation with Length::make_px(CSSPixels)

This commit is contained in:
Sam Atkins 2022-11-08 16:58:15 +00:00 committed by Linus Groh
parent 13b1952929
commit 7d40e3eb0d
5 changed files with 4 additions and 16 deletions

View file

@ -72,8 +72,8 @@ Optional<float> SVGGraphicsElement::stroke_width() const
float viewport_height = 0;
if (auto* svg_svg_element = first_ancestor_of_type<SVGSVGElement>()) {
if (auto* svg_svg_layout_node = svg_svg_element->layout_node()) {
viewport_width = svg_svg_layout_node->computed_values().width().resolved(*svg_svg_layout_node, { 0, CSS::Length::Type::Px }).to_px(*svg_svg_layout_node);
viewport_height = svg_svg_layout_node->computed_values().height().resolved(*svg_svg_layout_node, { 0, CSS::Length::Type::Px }).to_px(*svg_svg_layout_node);
viewport_width = svg_svg_layout_node->computed_values().width().resolved(*svg_svg_layout_node, CSS::Length::make_px(0)).to_px(*svg_svg_layout_node);
viewport_height = svg_svg_layout_node->computed_values().height().resolved(*svg_svg_layout_node, CSS::Length::make_px(0)).to_px(*svg_svg_layout_node);
}
}
auto scaled_viewport_size = CSS::Length::make_px((viewport_width + viewport_height) * 0.5f);