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

LibWeb: Scale SVG stroke-width based on viewbox

This fixes the clipping of strokes in quite a few cases and now fixes
the Gartic Phone logo :^)

(Layout test updated but no visible changes there)
This commit is contained in:
MacDue 2023-04-15 15:32:17 +01:00 committed by Andreas Kling
parent cb79c6bc2f
commit f9c61e3ba7
5 changed files with 33 additions and 21 deletions

View file

@ -28,6 +28,13 @@ public:
Optional<Gfx::Color> stroke_color() const;
Optional<float> stroke_width() const;
float visible_stroke_width() const
{
if (auto color = stroke_color(); color.has_value() && color->alpha() > 0)
return stroke_width().value_or(0);
return 0;
}
Gfx::AffineTransform get_transform() const;
protected: