|
From: Ethan A M. <merritt@u.washington.edu> - 2006-07-16 18:44:32
|
On Saturday 15 July 2006 01:04 am, Timoth=C3=A9e Lecomte wrote: > this one comes from graphics.c:3408 : >=20 > x =3D xl; > y =3D yb; > w =3D xr - xl + 1; > h =3D yt - yb + 1; > (*t->fillbox) (style, x, y, w, h); > (*t->move) (xl, yb); > (*t->vector) (xl, yt); > (*t->vector) (xr, yt); > (*t->vector) (xr, yb); > (*t->vector) (xl, yb); >=20 > I think these "+1" should be removed for consistency with the other uses. I'm not so sure. The length in pixels of a line that starts at pixel x1 and ends at pixel x2 is (x2-x1)+1. So this code looks correct to me. It may well be that some terminals interpret w and h incorrectly, but that would be an error in the individual terminal driver, not the core code.=20 I guess the fundamental question is whether "width" should be interpreted as "number of horizontal pixels" or "x_right - x_left". These are not the same number. The former makes sense if you are thinking in terms of terminal coords (pixels); the latter makes sense if you are thinking in=20 terms of a continuous variable (plot x coordinate). Either way, we need to audit the code to be consistent. IMHO an off-by-one-pixel error is not release-critical, however. If there's a simple fix to the core code that makes things more consistent, fine. But if we need to poke about in all the individuals drivers, let's not do this for 4.2. =2D-=20 Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |