Date:2013-01-31 07:15:33 (6 years 6 months ago)
Author:Werner Almesberger
Commit:a83d8bf323f16fecc144871113821e629ce824e8
Message:ubb-la/gui.c: add small gap (UNIT_GAP) between numbers and units

Files: ubb-la/gui.c (3 diffs)

Change Details

ubb-la/gui.c
6767
6868#define MAX_ZOOM 3
6969
70#define UNIT_GAP 2 /* space between number and unit */
71
7072#define FREQ_X 0
7173#define FREQ_Y 220
7274#define INTERVAL_X 0
7375#define INTERVAL_Y 230
74#define DIV_SAMP_X (80-8)
76#define DIV_SAMP_X (DIV_INT_X-8)
7577#define DIV_SAMP_Y FREQ_Y
7678#define DIV_INT_X 80
7779#define DIV_INT_Y INTERVAL_Y
...... 
352354        textf(x, y, TEXT_RGBA, "%3d", (int) (v+0.5));
353355    else
354356        textf(x, y, TEXT_RGBA, "%3.1f", v);
355    textf(x+3*8, y, UNIT_RGBA, "%s%s", pfx, unit);
357    textf(x+3*8+UNIT_GAP, y, UNIT_RGBA, "%s%s", pfx, unit);
356358}
357359
358360
...... 
364366    si_text(INTERVAL_X, INTERVAL_Y, 1/freq, "s/Sa");
365367    div = (DIV_X >> MAX_ZOOM) << (MAX_ZOOM-zoom);
366368    textf(DIV_SAMP_X, DIV_SAMP_Y, TEXT_RGBA, "%4d", div);
367    textf(DIV_SAMP_X+4*8, DIV_SAMP_Y, UNIT_RGBA, "Sa/div", div);
369    textf(DIV_SAMP_X+4*8+UNIT_GAP, DIV_SAMP_Y, UNIT_RGBA, "Sa/div", div);
368370    si_text(DIV_INT_X, DIV_INT_Y, div/freq, "s/div");
369371}
370372

Archive Download the corresponding diff file

Branches:
master



interactive