1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-23 17:34:37 +02:00

ubb-la/gui.c (XWIDTH): move view width into macro instead of open-coding it

This commit is contained in:
Werner Almesberger 2013-01-31 01:11:18 -03:00
parent acd9fd6673
commit 8d81b584a0

View File

@ -44,6 +44,7 @@
#define DIV_RGBA 0x808080ff /* divisions */
#define XCENTER ((XRES+CH_XOFF)/2)
#define XWIDTH (XRES-CH_XOFF)
#define MAP_BUF_Y0 2
#define MAP_BUF_Y1 8
@ -150,7 +151,7 @@ static void show_map(int skip, int nibbles, int s0, int s1)
int m = (nibbles+skip) >> 1;
int scale = 0;
while (w >= (XRES-CH_XOFF)/2) {
while (w >= XWIDTH/2) {
w >>= 1;
scale++;
}
@ -351,7 +352,7 @@ static void show_freq(double freq)
static void show_divisions(void)
{
int n = (XRES-CH_XOFF)/2/DIV_X;
int n = XWIDTH/2/DIV_X;
int i;
for (i = -n; i <= n; i++)
@ -377,7 +378,7 @@ void gui(const uint8_t *buf, int skip, int nibbles, double freq)
int min_zoom = 0;
int i;
while (XRES-CH_XOFF < (nibbles-skip) >> -min_zoom)
while (XWIDTH < (nibbles-skip) >> -min_zoom)
min_zoom--;
zoom = min_zoom;
while (1) {