From 68f0d21cc45989c537047ab1e0cc08de960c66f1 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 30 Aug 2019 14:28:32 +0200 Subject: [PATCH] Ignore the prefix and suffix in the SpinBox expression This fixes a regression caused by 86a31e9e385c7909a0cdd24a5ee790c3dca03b98. --- scene/gui/spin_box.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index 3c63f6b2c70..172c366c41c 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 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; }