diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-09-28 10:07:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-28 10:07:08 +0200 |
commit | 82d1265185d27a7520167b1dd3955787bcc35bb1 (patch) | |
tree | 59fd0eaffd2fc66ee6075cb086ee710ae240b64f | |
parent | 80165210c31b79e12e2a59e481232ae7eeccbfac (diff) | |
parent | 3800e7d2ba154f1355c62e86d9fe2addc53c37e5 (diff) |
Merge pull request #42376 from Calinou/editorspinslider-comma-decimal
Allow using a comma as decimal separator in EditorSpinSlider
-rw-r--r-- | editor/editor_spin_slider.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index d76a3d2da7..ac61a75a6c 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -356,7 +356,12 @@ String EditorSpinSlider::get_label() const { } void EditorSpinSlider::_evaluate_input_text() { - String text = value_input->get_text(); + // Replace comma with dot to support it as decimal separator (GH-6028). + // This prevents using functions like `pow()`, but using functions + // in EditorSpinSlider is a barely known (and barely used) feature. + // Instead, we'd rather support German/French keyboard layouts out of the box. + const String text = value_input->get_text().replace(",", "."); + Ref<Expression> expr; expr.instance(); Error err = expr->parse(text); |