mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:17:44 +00:00
LibWeb: Allow (explicitly) converting CSSPixels to float and int
...and remove some unnecessary cast chains.
This commit is contained in:
parent
c20df34b79
commit
5f0d3c083f
11 changed files with 16 additions and 14 deletions
|
@ -29,10 +29,10 @@ Optional<Gfx::AffineTransform> SVGTextBox::layout_transform() const
|
|||
auto& geometry_element = dom_node();
|
||||
auto transform = geometry_element.get_transform();
|
||||
auto* svg_box = geometry_element.first_ancestor_of_type<SVG::SVGSVGElement>();
|
||||
auto origin = viewbox_origin().to_type<double>().to_type<float>();
|
||||
auto origin = viewbox_origin().to_type<float>();
|
||||
Gfx::FloatPoint paint_offset = {};
|
||||
if (svg_box && svg_box->view_box().has_value())
|
||||
paint_offset = svg_box->paintable_box()->absolute_rect().location().to_type<double>().to_type<float>();
|
||||
paint_offset = svg_box->paintable_box()->absolute_rect().location().to_type<float>();
|
||||
return Gfx::AffineTransform {}.translate(paint_offset).translate(-origin).multiply(transform);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue