Fixed incorrect locales handling in the UI (Field, ObjectManipulation, etc)

This commit is contained in:
Lukas Matena 2021-05-24 12:22:46 +02:00
parent c05b8210f2
commit 4960b125c5
6 changed files with 56 additions and 28 deletions

View file

@ -98,9 +98,14 @@ ExtruderSequenceDialog::ExtruderSequenceDialog(const DoubleSlider::ExtrudersSequ
return;
}
str.Replace(",", ".", false);
char dec_sep = '.';
if (! is_decimal_separator_point()) {
str.Replace(".", ",", false);
dec_sep = ',';
}
double val;
if (str == "." || !str.ToCDouble(&val) || val <= 0.0)
if (str == dec_sep || !str.ToDouble(&val) || val <= 0.0)
val = 3.0; // default value
if (fabs(m_sequence.interval_by_layers - val) < 0.001)