From 6f92424bab82f1795697b21e074e4652529271ff Mon Sep 17 00:00:00 2001 From: bubnikv Date: Mon, 12 Feb 2018 19:06:05 +0100 Subject: [PATCH] Fix of https://github.com/prusa3d/Slic3r/issues/709 A regression error has been introduced into Slic3r 1.38.xx series for the float/percent config value, where the value was considered unchanged if the percent sign has been added or removed. --- xs/src/libslic3r/Config.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xs/src/libslic3r/Config.hpp b/xs/src/libslic3r/Config.hpp index e04f4df826..a58bb613ae 100644 --- a/xs/src/libslic3r/Config.hpp +++ b/xs/src/libslic3r/Config.hpp @@ -582,6 +582,13 @@ public: ConfigOptionType type() const override { return static_type(); } ConfigOption* clone() const override { return new ConfigOptionFloatOrPercent(*this); } ConfigOptionFloatOrPercent& operator=(const ConfigOption *opt) { this->set(opt); return *this; } + bool operator==(const ConfigOption &rhs) const override + { + if (rhs.type() != this->type()) + throw std::runtime_error("ConfigOptionFloatOrPercent: Comparing incompatible types"); + assert(dynamic_cast(&rhs)); + return *this == *static_cast(&rhs); + } bool operator==(const ConfigOptionFloatOrPercent &rhs) const { return this->value == rhs.value && this->percent == rhs.percent; } double get_abs_value(double ratio_over) const