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:
commit
efbd2bbf18
@ -53,7 +53,8 @@ void SpinBox::_text_entered(const String &p_string) {
|
|||||||
|
|
||||||
Ref<Expression> expr;
|
Ref<Expression> expr;
|
||||||
expr.instance();
|
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) {
|
if (err != OK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user