diff --git a/source/svgelement.cpp b/source/svgelement.cpp index efcf5a2..d3d9f72 100644 --- a/source/svgelement.cpp +++ b/source/svgelement.cpp @@ -10,11 +10,6 @@ namespace lunasvg { -SVGRootElement* SVGNode::rootElement() const -{ - return document()->rootElement(); -} - ElementID elementid(const std::string_view& name) { static const struct { diff --git a/source/svgelement.h b/source/svgelement.h index 6aa7a1b..f9421a8 100644 --- a/source/svgelement.h +++ b/source/svgelement.h @@ -1,14 +1,14 @@ #ifndef LUNASVG_SVGELEMENT_H #define LUNASVG_SVGELEMENT_H +#include "lunasvg.h" +#include "svgproperty.h" + #include #include #include #include -#include "svgproperty.h" -#include "lunasvg.h" - namespace lunasvg { class Document; @@ -29,10 +29,11 @@ class SVGNode { virtual bool isGeometryElement() const { return false; } virtual bool isTextPositioningElement() const { return false; } - SVGRootElement* rootElement() const; Document* document() const { return m_document; } - void setParent(SVGElement* parent) { m_parent = parent; } + SVGRootElement* rootElement() const { return m_document->rootElement(); } + SVGElement* parent() const { return m_parent; } + void setParent(SVGElement* parent) { m_parent = parent; } virtual std::unique_ptr clone(bool deep) const = 0;