Ignore the prefix and suffix in the SpinBox expression

This fixes a regression caused by
86a31e9e38.
This commit is contained in:
Hugo Locurcio 2019-08-30 14:28:32 +02:00
parent ca652bbc47
commit 68f0d21cc4
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C
1 changed files with 2 additions and 1 deletions

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;
}