1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

LibWeb: Convert Paintable coordinates to new pixel units

This fixes a few sizing issues too. The page size is now correct in most
cases! \o/

We get to remove some of the `to_type<>()` shenanigans, though it
reappears in some other places.
This commit is contained in:
Sam Atkins 2022-10-31 19:46:55 +00:00 committed by Linus Groh
parent 57a69f15ff
commit ab49dbf137
39 changed files with 200 additions and 179 deletions

View file

@ -36,10 +36,10 @@ void SVGPaintable::after_children_paint(PaintContext& context, PaintPhase phase)
context.svg_context().restore();
}
Gfx::FloatRect SVGPaintable::compute_absolute_rect() const
CSSPixelRect SVGPaintable::compute_absolute_rect() const
{
if (auto* svg_svg_box = layout_box().first_ancestor_of_type<Layout::SVGSVGBox>()) {
Gfx::FloatRect rect { effective_offset(), content_size() };
CSSPixelRect rect { effective_offset(), content_size() };
for (Layout::Box const* ancestor = svg_svg_box; ancestor && ancestor->paintable(); ancestor = ancestor->paintable()->containing_block())
rect.translate_by(ancestor->paint_box()->effective_offset());
return rect;