mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-23 18:15:55 +02:00
ubb-la/gui.c (show_buffer): fix calculation of the position offset (dp)
"pos" counts from zero so the middle point is (nibbles-skip)/2 while the code assumed "pos" was an index into the actual buffer and the middle point would therefore have been (nibbles+skip)/2
This commit is contained in:
parent
8b69d26fa9
commit
137ed18dc2
@ -300,7 +300,7 @@ static void show_buffer(const uint8_t *buf, int skip, int nibbles,
|
||||
int d, dp;
|
||||
|
||||
xm = (x0+x1) >> 1;
|
||||
dp = pos-((nibbles+skip) >> 1);
|
||||
dp = pos-((nibbles-skip) >> 1);
|
||||
DEBUG("show: %d-%d Sa; %d-%d pix; pos %d dp %d; xm %d xcenter %d\n",
|
||||
skip, nibbles, x0, x1, pos, dp, xm, XCENTER);
|
||||
if (zoom < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user