Date:2013-01-31 18:41:10 (6 years 4 months ago)
Author:Werner Almesberger
Commit:137ed18dc20fc217b22172072dd643ca0a7c121f
Message: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
Files: ubb-la/gui.c (1 diff)

Change Details

ubb-la/gui.c
300300    int d, dp;
301301
302302    xm = (x0+x1) >> 1;
303    dp = pos-((nibbles+skip) >> 1);
303    dp = pos-((nibbles-skip) >> 1);
304304    DEBUG("show: %d-%d Sa; %d-%d pix; pos %d dp %d; xm %d xcenter %d\n",
305305        skip, nibbles, x0, x1, pos, dp, xm, XCENTER);
306306    if (zoom < 0) {

Archive Download the corresponding diff file

Branches:
master



interactive