diff --git a/source/svgelement.cpp b/source/svgelement.cpp index d3d9f72..acb3e62 100644 --- a/source/svgelement.cpp +++ b/source/svgelement.cpp @@ -53,6 +53,12 @@ SVGTextNode::SVGTextNode(Document* document) { } +void SVGTextNode::setData(const std::string& data) +{ + rootElement()->setNeedsLayout(); + m_data.assign(data); +} + std::unique_ptr SVGTextNode::clone(bool deep) const { auto node = std::make_unique(document()); diff --git a/source/svgelement.h b/source/svgelement.h index f9421a8..ce04837 100644 --- a/source/svgelement.h +++ b/source/svgelement.h @@ -50,8 +50,8 @@ class SVGTextNode final : public SVGNode { bool isTextNode() const final { return true; } - void setData(const std::string& data) { m_data = data; } const std::string& data() const { return m_data; } + void setData(const std::string& data); std::unique_ptr clone(bool deep) const final;