[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info-beta
Subject:    Re: strange box-offset
From:       Timothée Lecomte <timothee.lecomte () ens ! fr>
Date:       2006-07-15 7:04:50
Message-ID: 44B8A1A4.5040204 () ens ! fr
[Download RAW message or body]

Timothée Lecomte a écrit :
> 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) => 34 = area.x
> move 479, 348 (0, 0)
> vect 479, 352 (0, 4) => 4 = 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 != 
2*(key_entry_height/4) as soon as key_entry_height is not a multiple of 
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) => 6 = area.y -1
> vect 108, 20 (20, 0) => 20 = area.x -1
> vect 108, 14 (0, -6)
> vect 88, 14 (-20, 0)
And this one comes from graphics.c:3408 :

x = xl;
y = yb;
w = xr - xl + 1;
h = 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 give 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ée


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic