Skip to content

Commit

Permalink
Fix updating value of SpinBox with prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
volzhs committed Nov 4, 2016
1 parent 90519b2 commit 80b6507
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scene/gui/spin_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 80b6507

Please sign in to comment.