mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
LibWeb: Avoid duplicating SVG viewbox height calculation
This commit is contained in:
parent
0374c1eb3b
commit
c1b1233575
Notes:
sideshowbarker
2024-07-17 08:13:43 +09:00
Author: https://github.com/tcl3
Commit: c1b1233575
Pull-request: https://github.com/SerenityOS/serenity/pull/23646
1 changed files with 3 additions and 3 deletions
|
@ -73,9 +73,9 @@ Optional<CSSPixelFraction> 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 {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue