Skip to content

Commit

Permalink
Allow using a comma as decimal separator in EditorSpinSlider
Browse files Browse the repository at this point in the history
This closes godotengine/godot-proposals#1576.

(cherry picked from commit 3800e7d)
  • Loading branch information
Calinou authored and akien-mga committed Sep 29, 2020
1 parent f8cc789 commit ebff4c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion editor/editor_spin_slider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,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);
Expand Down

0 comments on commit ebff4c3

Please sign in to comment.