diff options
| author | volzhs | 2016-11-05 02:34:19 +0900 |
|---|---|---|
| committer | volzhs | 2016-11-05 02:34:19 +0900 |
| commit | 80b6507071ffd65f4ed397b7994482229fb303e0 (patch) | |
| tree | 9863d1d59daa0fd8bc971c0135ae96c4a84bded9 /scene/gui/spin_box.cpp | |
| parent | 90519b295c234fd8c13647892ff711852445e2a1 (diff) | |
| download | godot-80b6507071ffd65f4ed397b7994482229fb303e0.tar.gz godot-80b6507071ffd65f4ed397b7994482229fb303e0.tar.zst godot-80b6507071ffd65f4ed397b7994482229fb303e0.zip | |
Diffstat (limited to 'scene/gui/spin_box.cpp')
| -rw-r--r-- | scene/gui/spin_box.cpp | 5 |
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); } |
