summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-08-30 16:09:06 +0200
committerGitHub <noreply@github.com>2019-08-30 16:09:06 +0200
commitefbd2bbf18eb98b07a4cbfe02c8768029c4842a7 (patch)
tree8aefd62dd709d5f627eb917b67a1d6e4fc424b5e /scene/gui
parent58e7cbccc093e735dce79b5fd194a55f9a0f376d (diff)
parent68f0d21cc45989c537047ab1e0cc08de960c66f1 (diff)
Merge pull request #31792 from Calinou/spinbox-expression-ignore-prefix-suffix
Ignore the prefix and suffix in the SpinBox expression
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/spin_box.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp
index 3c63f6b2c7..172c366c41 100644
--- a/scene/gui/spin_box.cpp
+++ b/scene/gui/spin_box.cpp
@@ -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;
}