aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvolzhs2016-11-05 02:34:19 +0900
committerRémi Verschelde2016-11-15 08:30:02 +0100
commit82b458f160e4627f25c34cb16370bb26f18f6c74 (patch)
tree4047fa508d13210e0f82aa32af1d11460f0004e9
parent64f38490df09f329c290cc3422a0f52eed50de04 (diff)
downloadgodot-82b458f160e4627f25c34cb16370bb26f18f6c74.tar.gz
godot-82b458f160e4627f25c34cb16370bb26f18f6c74.tar.zst
godot-82b458f160e4627f25c34cb16370bb26f18f6c74.zip
Fix updating value of SpinBox with prefix
(cherry picked from commit 80b6507071ffd65f4ed397b7994482229fb303e0)
-rw-r--r--scene/gui/spin_box.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp
index 98e1a32ae..9417c2542 100644
--- a/scene/gui/spin_box.cpp
+++ b/scene/gui/spin_box.cpp
@@ -51,7 +51,10 @@ void SpinBox::_text_entered(const String& p_string) {
//if (!p_string.is_numeric())
// return;
- set_val( p_string.to_double() );
+ String value = p_string;
+ if (prefix!="" && p_string.begins_with(prefix))
+ value = p_string.substr(prefix.length(), p_string.length()-prefix.length());
+ set_val( value.to_double() );
_value_changed(0);
}