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

LibWeb: Apply SVG transform to path when painting (SVG) elements

This also combines the viewbox mapping into the same transform and
reuses some code by using Path::copy_transformed() rather than manually
mapping each segment of the path.
This commit is contained in:
MacDue 2023-04-10 12:32:55 +01:00 committed by Andreas Kling
parent 3484db0dc1
commit cf23a2b82d
3 changed files with 27 additions and 67 deletions

View file

@ -21,12 +21,13 @@ public:
SVG::SVGGeometryElement& dom_node() { return static_cast<SVG::SVGGeometryElement&>(SVGGraphicsBox::dom_node()); }
SVG::SVGGeometryElement const& dom_node() const { return static_cast<SVG::SVGGeometryElement const&>(SVGGraphicsBox::dom_node()); }
float viewbox_scaling() const;
CSSPixelPoint viewbox_origin() const;
Gfx::AffineTransform layout_transform() const;
virtual JS::GCPtr<Painting::Paintable> create_paintable() const override;
private:
CSSPixelPoint viewbox_origin() const;
virtual bool is_svg_geometry_box() const final { return true; }
};