Skip to content

Commit

Permalink
fix: Size factor persisted after node was removed (#2013)
Browse files Browse the repository at this point in the history
  • Loading branch information
trisyoungs authored Nov 20, 2024
1 parent 6130ea2 commit 6f707b2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/classes/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ bool Configuration::initialiseContent(const GeneratorContext &generatorContext)
empty();

appliedSizeFactor_ = std::nullopt;
requestedSizeFactor_ = defaultSizeFactor_;

// Run the generator Generator
if (!generate(generatorContext))
Expand Down
7 changes: 7 additions & 0 deletions src/generator/sizeFactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ SizeFactorGeneratorNode::SizeFactorGeneratorNode() : GeneratorNode(NodeType::Siz
keywords_.add<NodeValueKeyword>("SizeFactor", "Size factor scaling to apply to configuration", sizeFactor_, this);
}

/*
* Identity
*/

// Return whether a name for the node must be provided
bool SizeFactorGeneratorNode::mustBeNamed() const { return false; }

/*
* Execute
*/
Expand Down
7 changes: 7 additions & 0 deletions src/generator/sizeFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ class SizeFactorGeneratorNode : public GeneratorNode
private:
NodeValue sizeFactor_{10.0};

/*
* Identity
*/
public:
// Return whether a name for the node must be provided
bool mustBeNamed() const override;

/*
* Execute
*/
Expand Down

0 comments on commit 6f707b2

Please sign in to comment.