|
@@ -8,12 +8,14 @@
|
|
|
|
|
|
#include <AK/Vector.h>
|
|
#include <AK/Vector.h>
|
|
#include <LibGfx/Color.h>
|
|
#include <LibGfx/Color.h>
|
|
|
|
+#include <LibGfx/Rect.h>
|
|
|
|
|
|
namespace Web {
|
|
namespace Web {
|
|
|
|
|
|
class SVGContext {
|
|
class SVGContext {
|
|
public:
|
|
public:
|
|
- SVGContext()
|
|
|
|
|
|
+ SVGContext(Gfx::FloatRect svg_element_bounds)
|
|
|
|
+ : m_svg_element_bounds(svg_element_bounds)
|
|
{
|
|
{
|
|
m_states.append(State());
|
|
m_states.append(State());
|
|
}
|
|
}
|
|
@@ -26,6 +28,8 @@ public:
|
|
void set_stroke_color(Gfx::Color color) { state().stroke_color = color; }
|
|
void set_stroke_color(Gfx::Color color) { state().stroke_color = color; }
|
|
void set_stroke_width(float width) { state().stroke_width = width; }
|
|
void set_stroke_width(float width) { state().stroke_width = width; }
|
|
|
|
|
|
|
|
+ Gfx::FloatPoint svg_element_position() const { return m_svg_element_bounds.top_left(); }
|
|
|
|
+
|
|
void save() { m_states.append(m_states.last()); }
|
|
void save() { m_states.append(m_states.last()); }
|
|
void restore() { m_states.take_last(); }
|
|
void restore() { m_states.take_last(); }
|
|
|
|
|
|
@@ -39,6 +43,7 @@ private:
|
|
const State& state() const { return m_states.last(); }
|
|
const State& state() const { return m_states.last(); }
|
|
State& state() { return m_states.last(); }
|
|
State& state() { return m_states.last(); }
|
|
|
|
|
|
|
|
+ Gfx::FloatRect m_svg_element_bounds;
|
|
Vector<State> m_states;
|
|
Vector<State> m_states;
|
|
};
|
|
};
|
|
|
|
|