FIX: support config editing of type FloatsOrPercents

Change-Id: If0821dc357b14f1b72aa1c89b3b0378947e80a5c
Jira: none
(cherry picked from commit 115fb9ce072273acf8df558a33fe48cf71f8e35b)
(cherry picked from commit 0c03a6b3616b855ccad5e629834d09672de334d7)
This commit is contained in:
chunmao.guo 2024-07-19 09:59:23 +08:00 committed by Noisyfox
parent fc76348330
commit f33f2fbc7d
4 changed files with 53 additions and 31 deletions

View file

@ -1024,7 +1024,16 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config
ret = text_value;
break;
}
case coPercent:{
case coFloatsOrPercents: {
const auto &value = config.option<ConfigOptionFloatsOrPercents>(opt_key)->get_at(idx);
text_value = double_to_string(value.value);
if (value.percent) text_value += "%";
ret = text_value;
break;
}
case coPercent: {
double val = config.option<ConfigOptionPercent>(opt_key)->value;
ret = double_to_string(val);// += "%";
}