mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-16 22:12:29 +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:
parent
9cc032816e
commit
60b375135f
@ -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));
|
textf(x, y, TEXT_RGBA, "%3d", (int) (v+0.5));
|
||||||
else if (v >= 100 && digits == 4)
|
else if (v >= 100 && digits == 4)
|
||||||
textf(x, y, TEXT_RGBA, "%4d", (int) (v+0.5));
|
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)
|
else if (v >= 100)
|
||||||
textf(x, y, TEXT_RGBA, "%*.*f", digits, digits-4, v);
|
textf(x, y, TEXT_RGBA, "%*.*f", digits, digits-4, v);
|
||||||
else if (v >= 10)
|
else if (v >= 10)
|
||||||
|
Loading…
Reference in New Issue
Block a user