From c1b1233575efbcf957518df6f6fb6793b5236814 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Tue, 19 Mar 2024 23:45:34 +0000 Subject: [PATCH] LibWeb: Avoid duplicating SVG viewbox height calculation --- Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp b/Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp index 6baa12a5c2e..eb06ffc8e15 100644 --- a/Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp @@ -73,9 +73,9 @@ Optional SVGSVGBox::calculate_intrinsic_aspect_ratio() const auto const& viewbox = dom_node().view_box().value(); // 2. return viewbox.width / viewbox.height - auto height = CSSPixels::nearest_value_for(viewbox.height); - if (height != 0) - return CSSPixels::nearest_value_for(viewbox.width) / CSSPixels::nearest_value_for(viewbox.height); + auto viewbox_height = CSSPixels::nearest_value_for(viewbox.height); + if (viewbox_height != 0) + return CSSPixels::nearest_value_for(viewbox.width) / viewbox_height; return {}; }