From d92530b4b88ab8bd97587316946713b7c1711629 Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Mon, 29 Oct 2018 09:39:07 +0100 Subject: [PATCH] Fix: PlaceholderParser float comparison --- src/libslic3r/PlaceholderParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/PlaceholderParser.cpp b/src/libslic3r/PlaceholderParser.cpp index 331a42614..2b11269a0 100644 --- a/src/libslic3r/PlaceholderParser.cpp +++ b/src/libslic3r/PlaceholderParser.cpp @@ -111,9 +111,9 @@ bool PlaceholderParser::apply_config(const DynamicPrintConfig &rhs) const ConfigOption *opt_rhs = rhs.option(opt_key); const ConfigOption *opt_old = m_config.option(opt_key, false); if (opt_old != nullptr) { - if ((opt_rhs->type() == coFloatOrPercent && - dynamic_cast(opt_old)->value == rhs.get_abs_value(opt_key)) || - *opt_rhs == *opt_old) + if (opt_rhs->type() == coFloatOrPercent ? + dynamic_cast(opt_old)->value == rhs.get_abs_value(opt_key) + : *opt_rhs == *opt_old) // no need to update continue; }