From 6f707b2a94e8fb764c0d851e5e0b8a0455303694 Mon Sep 17 00:00:00 2001 From: Tristan Youngs Date: Wed, 20 Nov 2024 11:07:40 +0000 Subject: [PATCH] fix: Size factor persisted after node was removed (#2013) --- src/classes/configuration.cpp | 1 + src/generator/sizeFactor.cpp | 7 +++++++ src/generator/sizeFactor.h | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/src/classes/configuration.cpp b/src/classes/configuration.cpp index 46970d16da..f07f673484 100644 --- a/src/classes/configuration.cpp +++ b/src/classes/configuration.cpp @@ -98,6 +98,7 @@ bool Configuration::initialiseContent(const GeneratorContext &generatorContext) empty(); appliedSizeFactor_ = std::nullopt; + requestedSizeFactor_ = defaultSizeFactor_; // Run the generator Generator if (!generate(generatorContext)) diff --git a/src/generator/sizeFactor.cpp b/src/generator/sizeFactor.cpp index c7fb4809b0..b3c396515a 100644 --- a/src/generator/sizeFactor.cpp +++ b/src/generator/sizeFactor.cpp @@ -11,6 +11,13 @@ SizeFactorGeneratorNode::SizeFactorGeneratorNode() : GeneratorNode(NodeType::Siz keywords_.add("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 */ diff --git a/src/generator/sizeFactor.h b/src/generator/sizeFactor.h index 97ef54ab7b..bb088aea17 100644 --- a/src/generator/sizeFactor.h +++ b/src/generator/sizeFactor.h @@ -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 */