|
From: <tim...@en...> - 2006-07-15 07:04:43
|
Timoth=C3=A9e Lecomte a =C3=A9crit :
> Just to confirm the differences between the way the core uses fillboxes=
,
> here is the code for one patterned rectangle generated by "test" to the
> debug terminal :
>
> fillbox/clear at (418d,0d), area (12d,48d), style 146)
> move 418, 0
> vect 418, 48 (0, 48)
> vect 430, 48 (12, 0)
> vect 430, 0 (0, -48)
> vect 418, 0 (-12, 0)
This comes from the code (term.c:2032) :
(*t->fillbox) ( style, x, y, xl, yl );
(*t->move) (x,y);
(*t->vector)(x,y+yl);
(*t->vector)(x+xl,y+yl);
(*t->vector)(x+xl,y);
(*t->vector)(x,y);
which looks reasonable.
>
> to compare with what Mojca pointed out :
> (...)
> Legends of "plots ... with boxes" :
>
> fillbox/clear at (445d,348d), area (34d,5d), style 0)
> move 445, 348
> vect 479, 348 (34, 0) =3D> 34 =3D area.x
> move 479, 348 (0, 0)
> vect 479, 352 (0, 4) =3D> 4 =3D area.y - 1
> move 479, 352 (0, 0)
> vect 445, 352 (-34, 0)
> move 445, 352 (0, 0)
> vect 445, 348 (0, -4)
This comes from the code (graphics.c:4132) :
(*t->fillbox)(style_from_fill(fs),
xl + key_sample_left, yl - key_entry_height/4,
key_sample_right - key_sample_left,
key_entry_height/2);
(*t->move) (xl + key_sample_left, yl - key_entry_height/4);
(*t->vector)(xl + key_sample_right, yl - key_entry_height/4);
(*t->vector)(xl + key_sample_right, yl + key_entry_height/4);
(*t->vector)(xl + key_sample_left, yl + key_entry_height/4);
(*t->vector)(xl + key_sample_left, yl - key_entry_height/4);
And the heights are different because key_entry_height/2 !=3D=20
2*(key_entry_height/4) as soon as key_entry_height is not a multiple of=20
4. This one is easy to fix.
>
> (Hmm, and a couple of useless "move", by the way)
>
> Fillboxes in the plot :
>
> fillbox/clear at (88d,14d), area (21d,7d), style 1601)
> move 88, 14
> vect 88, 20 (0, 6) =3D> 6 =3D area.y -1
> vect 108, 20 (20, 0) =3D> 20 =3D area.x -1
> vect 108, 14 (0, -6)
> vect 88, 14 (-20, 0)
And this one comes from graphics.c:3408 :
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);
And the "+1" have been here since the fillbox style appeared in the CVS.
I think these "+1" should be removed for consistency with the other uses.=
I'll write a patch tomorrow or sunday. However, it will be needed to giv=
e a look to most (all?) of the terminals, and I am not sure I can do that=
in a short time.
Pre- or Post- 4.2 ?
Timoth=C3=A9e
|