Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
sammycage committed Jan 3, 2025
1 parent eed37b4 commit 10f6500
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
5 changes: 0 additions & 5 deletions source/svgelement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@

namespace lunasvg {

SVGRootElement* SVGNode::rootElement() const
{
return document()->rootElement();
}

ElementID elementid(const std::string_view& name)
{
static const struct {
Expand Down
11 changes: 6 additions & 5 deletions source/svgelement.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#ifndef LUNASVG_SVGELEMENT_H
#define LUNASVG_SVGELEMENT_H

#include "lunasvg.h"
#include "svgproperty.h"

#include <string>
#include <forward_list>
#include <list>
#include <map>

#include "svgproperty.h"
#include "lunasvg.h"

namespace lunasvg {

class Document;
Expand All @@ -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<SVGNode> clone(bool deep) const = 0;

Expand Down

0 comments on commit 10f6500

Please sign in to comment.