mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:37:35 +00:00
LibWeb: Use the new to_px() helpers in CSS, SVG and layout code
There should be no behavior change from this, only slightly less verbosity. :^)
This commit is contained in:
parent
cdf0d3e905
commit
ca1fa5f748
14 changed files with 141 additions and 149 deletions
|
@ -29,7 +29,7 @@ CSSPixelPoint PositionValue::resolved(Layout::Node const& node, CSSPixelRect con
|
|||
}();
|
||||
},
|
||||
[&](LengthPercentage length_percentage) -> CSSPixels {
|
||||
return length_percentage.resolved(node, Length::make_px(rect.width())).to_px(node);
|
||||
return length_percentage.to_px(node, rect.width());
|
||||
});
|
||||
CSSPixels y = vertical_position.visit(
|
||||
[&](VerticalPreset preset) -> CSSPixels {
|
||||
|
@ -47,7 +47,7 @@ CSSPixelPoint PositionValue::resolved(Layout::Node const& node, CSSPixelRect con
|
|||
}();
|
||||
},
|
||||
[&](LengthPercentage length_percentage) -> CSSPixels {
|
||||
return length_percentage.resolved(node, Length::make_px(rect.height())).to_px(node);
|
||||
return length_percentage.to_px(node, rect.height());
|
||||
});
|
||||
if (x_relative_to == HorizontalEdge::Right)
|
||||
x = rect.width() - x;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue