From ca2ba49384e3c4efea2d2d226bdaf7083cff5ac1 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 18 Aug 2008 02:07:08 +0000 Subject: [PATCH] don't draw the last 0 in '0000' as a leading zero --- stepmania/src/RollingNumbers.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stepmania/src/RollingNumbers.cpp b/stepmania/src/RollingNumbers.cpp index 95439780c0..7e5ca2de13 100644 --- a/stepmania/src/RollingNumbers.cpp +++ b/stepmania/src/RollingNumbers.cpp @@ -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