Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsupermerill <merill@free.fr>2021-11-07 22:40:51 +0300
committersupermerill <merill@free.fr>2021-11-07 22:40:51 +0300
commitea00699e191940800fc903377dfa481556fbfcc2 (patch)
tree50f70a4a318d2e1ad8b2c37c3281e724c9e8c4cd /src
parentb5ae93d202120a4cbcdbc19afd73192df43d6cef (diff)
Fix import config with bridge flow < 1
supermerill/SuperSlicer/1818
Diffstat (limited to 'src')
-rw-r--r--src/libslic3r/PrintConfig.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp
index 46d77e229..a5f9e23a9 100644
--- a/src/libslic3r/PrintConfig.cpp
+++ b/src/libslic3r/PrintConfig.cpp
@@ -5746,6 +5746,17 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
}
if ("first_layer_min_speed" == opt_key && value.back() == '%')
value = value.substr(0, value.length() - 1); //no percent.
+ if ("bridge_flow_ratio" == opt_key && value.back() != '%') {
+ //need percent
+ try {
+ float val = boost::lexical_cast<float>(value);
+ if (val < 1.)
+ value = boost::lexical_cast<std::string>(val*100) + "%";
+ }
+ catch (boost::bad_lexical_cast&) {
+ value = "100%";
+ }
+ }
// Ignore the following obsolete configuration keys:
static std::set<std::string> ignore = {