|
From: Hans-Bernhard B. <br...@ph...> - 2005-08-18 04:06:36
|
Ethan Merritt wrote:
> On Wednesday 17 August 2005 11:06 am, Hans-Bernhard Broeker wrote:
>>Not really. It's the same problem in a different dress. Terminal
>>coordinates are really only valid in some interval. That interval
>>always has one endpoint at zero, by design, so it makes sense for the
>>coordinates to be unsigned. It being unsigned even helps generate
>>faster code: a single test for (x < term->xmax) will detect points that
>>are off to the right or the left.
> Detect, yes. But it does not allow you to clip the line segment.
That's OK --- clipping should not be done in the terminal driver anyway.
> For that you need the "true" negative coordinate so that you
> can interpolate the intersections with the plot borders.
More to the point, you need the original input, i.e. the floating-point
numbers that the plot elements are all specified in.
> I agree that the core routines should clip before sending to the
> drivers. Fine. The problem is that the core routines *themselves*
> use unsigned integers, which they should not.
Agreed, up to a point --- the key issue is that they have to clip
before converting any coordinates to integers, be those signed or
unsigned. For the classic plot styles, it's done by checking the data
points' validity flags (INRANGE/OUTRANGE/UNDEFINED). The 'with image'
implementation, in particular, never checks these flags. Odds are
that's exactly the root of the bug the OP found.
> But only if the terminal claims to have > 32768 pixels.
> Is that in fact the case?
Not by default, but it can be made to be.
>>Win16 always is close to behaving like that by default during
>>copy-to-clipboard (24000x18000 pixels). Many others, including
>>postscript, can be made to, if you only 'set size' high enough before
>>'set term' or use the driver's own 'size' option.
> 'set size' is itself highly problematic.
That's a side issue. 'set term png size 40000,30000' will fail just as
spectacularly ('test' on that one just crashed this machine) ;->
> I'll make the provocative assertion that size > 1.0 should not
> be allowed. Or allowed only with the caveat "if you set size > 1.0
> then do not complain if your terminal overflows or segfaults".
The docs already hint that it may not be the best of all imaginable
ideas to set size to something larger than 1.0. But I don't think that
it should be forbidden.
|