|
From: Hans-Bernhard B. <br...@ph...> - 2005-08-17 12:45:03
|
Ga=EBl Varoquaux wrote:
> With the standard terminal drivers (x11, post, png) this works without =
a
> flaw, but while working on the povray terminal, on the image code, I no=
ted
> that corner[0].x ends up being negative ! But it is a unsigned int !!
I.e. it's not really negative. It'll just look negative if you somewhat
incorrectly cast it to a signed value, which is what a printf("%d") will =
do behind your back.
Such a value being presented to the terminal driver is plain and simply=20
*wrong*, and the error was introduced by the core code: it computed a=20
pixel position that is outside the page boundaries and tried to draw=20
there. That's a bug. There are some areas where we can't really help=20
it, like with parts of text that may end up outside the page because we=20
don't really know how large they'll be in the output. For pixel=20
positions passed to term->vector() or similar functions, it's unacceptabl=
e.
> ridiculously high value printed. Printing it as an integer solves the
> problem,=20
No, it doesn't. It just obfuscates it. A POVray driver may not=20
actually care if you try to draw outside the page --- other drivers do,=20
and the core code must never assume it can step outside that border.
|