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

LibWeb: Add a basic SVGContext object, add to PaintContext

This will be used to transmit any svg-relevant data between svg nodes.
This is prep for moving a lot of the SVG logic into Layout nodes.
This commit is contained in:
Matthew Olsson 2020-10-05 16:13:26 -07:00 committed by Andreas Kling
parent 0b3b6310ec
commit f2055bb509
2 changed files with 69 additions and 0 deletions

View file

@ -29,6 +29,7 @@
#include <LibGfx/Forward.h>
#include <LibGfx/Palette.h>
#include <LibGfx/Rect.h>
#include <LibWeb/SVG/SVGContext.h>
namespace Web {
@ -44,6 +45,10 @@ public:
Gfx::Painter& painter() const { return m_painter; }
const Palette& palette() const { return m_palette; }
bool has_svg_context() const { return m_svg_context.has_value(); }
SVGContext& svg_context() { return m_svg_context.value(); }
void set_svg_context(SVGContext context) { m_svg_context = context; }
bool should_show_line_box_borders() const { return m_should_show_line_box_borders; }
void set_should_show_line_box_borders(bool value) { m_should_show_line_box_borders = value; }
@ -58,6 +63,7 @@ public:
private:
Gfx::Painter& m_painter;
Palette m_palette;
Optional<SVGContext> m_svg_context;
Gfx::IntRect m_viewport_rect;
Gfx::IntPoint m_scroll_offset;
bool m_should_show_line_box_borders { false };