1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-17 14:11:06 +00:00

Fix updating value of SpinBox with prefix

(cherry picked from commit 80b6507071)
This commit is contained in:
volzhs
2016-11-05 02:34:19 +09:00
committed by Rémi Verschelde
parent 64f38490df
commit 82b458f160

View File

@@ -51,7 +51,10 @@ void SpinBox::_text_entered(const String& p_string) {
//if (!p_string.is_numeric()) //if (!p_string.is_numeric())
// return; // 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); _value_changed(0);
} }