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

LibWeb: Try to work out the intrinsic size of <svg> elements

If the `width` and `height` attributes are provided, we derive the
intrinsic size and ratio from them.

Otherwise, we trace a rectangle around the geometry elements inside
the SVG and use the size of that as the intrinsic size.

This is definitely far from correct, but is still a much better guess
at the intrinsic size than nothing.
This commit is contained in:
Andreas Kling 2022-07-11 12:25:01 +02:00
parent 7dfd5afd37
commit 17a6fcfde3
2 changed files with 73 additions and 0 deletions

View file

@ -21,6 +21,8 @@ public:
virtual bool can_have_children() const override { return true; }
virtual RefPtr<Painting::Paintable> create_paintable() const override;
virtual void prepare_for_replaced_layout() override;
};
}