1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-23 18:15:55 +02:00

ubb-la/gui.c (si_text): used fixed %7.3f format if we have 7 characters

The variable number of digits was more confusing than useful. A drawback
is we may no longer see single-sample time changes when near the end of
the buffer.
This commit is contained in:
Werner Almesberger 2013-02-01 00:42:29 -03:00
parent 9cc032816e
commit 60b375135f

View File

@ -397,6 +397,8 @@ static void si_text(int x, int y, double v, const char *unit, int digits)
textf(x, y, TEXT_RGBA, "%3d", (int) (v+0.5));
else if (v >= 100 && digits == 4)
textf(x, y, TEXT_RGBA, "%4d", (int) (v+0.5));
else if (digits == 7)
textf(x, y, TEXT_RGBA, "%*.*f", digits, 3, v);
else if (v >= 100)
textf(x, y, TEXT_RGBA, "%*.*f", digits, digits-4, v);
else if (v >= 10)