From 159a128d2894792efa08f706c1e24173a283c6b8 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 31 Jan 2013 02:57:27 -0300 Subject: [PATCH] ubb-la.c/gui.c: show units in light blue to better separate them from numbers --- ubb-la/gui.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ubb-la/gui.c b/ubb-la/gui.c index d66d92f..cf695cd 100644 --- a/ubb-la/gui.c +++ b/ubb-la/gui.c @@ -33,6 +33,7 @@ #define YRES 240 /* canvas height */ #define TEXT_RGBA 0xffffffff /* general text */ +#define UNIT_RGBA 0xb0e0ffff /* units */ #define MAP_BUF_RGBA 0x808080ff /* buffer in the map */ #define MAP_VIEW_RGBA 0xffffffff /* current view in the map */ #define LEVEL_RGBA 0xffff00ff /* constant level or single change */ @@ -336,9 +337,10 @@ static void si_text(int x, int y, double v, const char *unit) pfx = "n"; } if (v >= 10) - textf(x, y, TEXT_RGBA, "%3d%s%s", (int) (v+0.5), pfx, unit); + textf(x, y, TEXT_RGBA, "%3d", (int) (v+0.5)); else - textf(x, y, TEXT_RGBA, "%3.1f%s%s", v, pfx, unit); + textf(x, y, TEXT_RGBA, "%3.1f", v); + textf(x+3*8, y, UNIT_RGBA, "%s%s", pfx, unit); } @@ -349,7 +351,8 @@ static void show_freq(double freq, int zoom) si_text(FREQ_X, FREQ_Y, freq, "Sa/s"); si_text(INTERVAL_X, INTERVAL_Y, 1/freq, "s/Sa"); div = (DIV_X >> MAX_ZOOM) << (MAX_ZOOM-zoom); - textf(DIV_SAMP_X, DIV_SAMP_Y, TEXT_RGBA, "%4dSa/div", div); + textf(DIV_SAMP_X, DIV_SAMP_Y, TEXT_RGBA, "%4d", div); + textf(DIV_SAMP_X+4*8, DIV_SAMP_Y, UNIT_RGBA, "Sa/div", div); si_text(DIV_INT_X, DIV_INT_Y, div/freq, "s/div"); }