Merge pull request #7036 from volzhs/spinbox-prefix
Fix updating value of SpinBox with prefix
This commit is contained in:
commit
c099b32b6c
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue