Skip to content

Commit

Permalink
Set needsLayout when TextNode is modified
Browse files Browse the repository at this point in the history
  • Loading branch information
sammycage committed Jan 3, 2025
1 parent 10f6500 commit 24d9036
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions source/svgelement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ SVGTextNode::SVGTextNode(Document* document)
{
}

void SVGTextNode::setData(const std::string& data)
{
rootElement()->setNeedsLayout();
m_data.assign(data);
}

std::unique_ptr<SVGNode> SVGTextNode::clone(bool deep) const
{
auto node = std::make_unique<SVGTextNode>(document());
Expand Down
2 changes: 1 addition & 1 deletion source/svgelement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<SVGNode> clone(bool deep) const final;

Expand Down

0 comments on commit 24d9036

Please sign in to comment.