don't draw the last 0 in '0000' as a leading zero
This commit is contained in:
@@ -36,11 +36,18 @@ void RollingNumbers::DrawPrimitives()
|
||||
|
||||
RString s = this->GetText();
|
||||
int i;
|
||||
// find the first non-zero, non-comma character
|
||||
for( i=0; i<(int)s.length(); i++ )
|
||||
{
|
||||
if( s[i] != '0' && s[i] != ',' )
|
||||
break;
|
||||
}
|
||||
// Rewind to the first number, even if it's a zero. If the string is "0000", we want the last zero to show in the regular color.
|
||||
for( ; i>=0; i-- )
|
||||
{
|
||||
if( s[i] >= '0' && s[i] <= '9' )
|
||||
break;
|
||||
}
|
||||
float f = i / (float)s.length();
|
||||
|
||||
// draw leading part
|
||||
|
||||
Reference in New Issue
Block a user