Merge pull request #31792 from Calinou/spinbox-expression-ignore-prefix-suffix

Ignore the prefix and suffix in the SpinBox expression
This commit is contained in:
Rémi Verschelde 2019-08-30 16:09:06 +02:00 committed by GitHub
commit efbd2bbf18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,8 @@ void SpinBox::_text_entered(const String &p_string) {
Ref<Expression> expr;
expr.instance();
Error err = expr->parse(p_string);
// Ignore the prefix and suffix in the expression
Error err = expr->parse(p_string.trim_prefix(prefix + " ").trim_suffix(" " + suffix));
if (err != OK) {
return;
}