aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvolzhs2016-11-05 02:34:19 +0900
committervolzhs2016-11-05 02:34:19 +0900
commit80b6507071ffd65f4ed397b7994482229fb303e0 (patch)
tree9863d1d59daa0fd8bc971c0135ae96c4a84bded9
parent90519b295c234fd8c13647892ff711852445e2a1 (diff)
downloadgodot-80b6507071ffd65f4ed397b7994482229fb303e0.tar.gz
godot-80b6507071ffd65f4ed397b7994482229fb303e0.tar.zst
godot-80b6507071ffd65f4ed397b7994482229fb303e0.zip
-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);
}