From a83d8bf323f16fecc144871113821e629ce824e8 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 31 Jan 2013 03:15:33 -0300 Subject: [PATCH] ubb-la/gui.c: add small gap (UNIT_GAP) between numbers and units --- ubb-la/gui.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ubb-la/gui.c b/ubb-la/gui.c index bb69a95..d83fecc 100644 --- a/ubb-la/gui.c +++ b/ubb-la/gui.c @@ -67,11 +67,13 @@ #define MAX_ZOOM 3 +#define UNIT_GAP 2 /* space between number and unit */ + #define FREQ_X 0 #define FREQ_Y 220 #define INTERVAL_X 0 #define INTERVAL_Y 230 -#define DIV_SAMP_X (80-8) +#define DIV_SAMP_X (DIV_INT_X-8) #define DIV_SAMP_Y FREQ_Y #define DIV_INT_X 80 #define DIV_INT_Y INTERVAL_Y @@ -352,7 +354,7 @@ static void si_text(int x, int y, double v, const char *unit) textf(x, y, TEXT_RGBA, "%3d", (int) (v+0.5)); else textf(x, y, TEXT_RGBA, "%3.1f", v); - textf(x+3*8, y, UNIT_RGBA, "%s%s", pfx, unit); + textf(x+3*8+UNIT_GAP, y, UNIT_RGBA, "%s%s", pfx, unit); } @@ -364,7 +366,7 @@ static void show_freq(double freq, int zoom) 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, "%4d", div); - textf(DIV_SAMP_X+4*8, DIV_SAMP_Y, UNIT_RGBA, "Sa/div", div); + textf(DIV_SAMP_X+4*8+UNIT_GAP, DIV_SAMP_Y, UNIT_RGBA, "Sa/div", div); si_text(DIV_INT_X, DIV_INT_Y, div/freq, "s/div"); }