Neaten a little bit of code
This commit is contained in:
parent
f36dafd9d3
commit
9c67d41ad6
@ -348,11 +348,11 @@ void Textbox::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
|
|||||||
}
|
}
|
||||||
if(inputType == Number)
|
if(inputType == Number)
|
||||||
{
|
{
|
||||||
if(backingText.length()>1)
|
//Remove extra preceding 0's
|
||||||
{
|
while(backingText[0] == '0' && backingText.length()>1)
|
||||||
while(backingText[0] == '0')
|
backingText.erase(backingText.begin());
|
||||||
backingText.erase(backingText.begin());
|
|
||||||
}
|
//If there is no content, replace with 0
|
||||||
if(!backingText.length())
|
if(!backingText.length())
|
||||||
backingText = "0";
|
backingText = "0";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user