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

LibWeb: Create LayoutNodes for each SVG element

This brings the SVG API closer to the rest of LibWeb
This commit is contained in:
Matthew Olsson 2020-10-05 16:14:36 -07:00 committed by Andreas Kling
parent f2055bb509
commit 455ce0b9c3
16 changed files with 402 additions and 122 deletions

View file

@ -32,7 +32,7 @@ class SVGContext {
public:
SVGContext()
{
push_state();
m_states.append(State());
}
const Gfx::Color& fill_color() const { return state().fill_color; }
@ -43,9 +43,8 @@ public:
void set_stroke_color(Gfx::Color color) { state().stroke_color = color; }
void set_stroke_width(float width) { state().stroke_width = width; }
void push_state() { m_states.append(State()); }
void pop_state() { m_states.take_last(); }
void save() { m_states.append(m_states.last()); }
void restore() { m_states.take_last(); }
private:
struct State {