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

LibWeb: Abstract common operations of graphical SVG elements

This commit is contained in:
Matthew Olsson 2020-07-22 15:17:39 -07:00 committed by Andreas Kling
parent 3206263c2d
commit 943e4f8bf1
5 changed files with 83 additions and 7 deletions

View file

@ -40,6 +40,16 @@ struct SvgPaintingContext {
class SvgGraphicElement {
public:
virtual void paint(const SvgPaintingContext&, Gfx::Painter& painter) = 0;
void parse_attribute(const FlyString& name, const String& value);
protected:
Gfx::Color fill_color(const SvgPaintingContext&) const;
Gfx::Color stroke_color(const SvgPaintingContext&) const;
float stroke_width(const SvgPaintingContext&) const;
Optional<Gfx::Color> m_fill_color;
Optional<Gfx::Color> m_stroke_color;
Optional<float> m_stroke_width;
};
}