(svn r25314) -Fix (r25313): If '0' is the broadest digit, 0 * sum(10^i, i=0..(n-1)) is not the broadest n-digit number.
-Fix [FS#5562]: Proper size-estimation for numbers with n digits.
This commit is contained in:
@@ -116,10 +116,11 @@ void SetDParamMaxValue(uint n, uint64 max_value, uint min_count, FontSize size)
|
||||
*/
|
||||
void SetDParamMaxDigits(uint n, uint count, FontSize size)
|
||||
{
|
||||
uint biggest_digit = GetBroadestDigit(size);
|
||||
uint64 val = biggest_digit;
|
||||
uint front, next;
|
||||
GetBroadestDigit(&front, &next, size);
|
||||
uint64 val = count > 1 ? front : next;
|
||||
for (; count > 1; count--) {
|
||||
val = 10 * val + biggest_digit;
|
||||
val = 10 * val + next;
|
||||
}
|
||||
SetDParam(n, val);
|
||||
}
|
||||
|
Reference in New Issue
Block a user