Maximum Picture Domain

Peter Achten peter88@cs.kun.nl
Mon, 01 Dec 1997 10:44:10 +0100


Dear Erik,

At 06:06 AM 12/1/97 +0100, you wrote:
>The 1993 Clean Book says that the 0.8 IO-library
>contains the constant MaxPictureDomain in module deltaSystem.
>In reality, it does not. I was looking for this because
>I have a program with a scroll window based on a picture domain
>of a few hundred pixels wide and 33135 pixels down.
>When I scroll to the end (down), the (re)drawing function does not
>behave there, nor does painting the background colour.
>
>The number of pixels, 33135, is just exceeding 2 to the
>power of 15. Does that happen to be a maximum? If so, wouldn't
>it be nicer if the system (the compiler, say) observed this
>and would cut off any picture domain to the maximum?

You are right, on the Macintosh drawing operations can not exceed 2^15-1 pixels (and neither be less than -(2^15-1)) in either direction. The PictureDomain is not checked by the 0.8 I/O system. Reality is however a bit more harsh, the actual maximum is 2^15-16 = 2^15-1-15, 15 accounting for the width of a Macintosh scrollbar :-). I agree this is not ideal, the library should take this in account in some way.

>Is what I observed still happening in the 1.0 IO-library?

In the object I/O system the PictureDomain has the same range as Integers, so that problem won't occur. However, the size of objects that are being drawn are ofcourse limited to the maximum size possible on the platform (drawing a line from (-2^30,-2^30) to (2^30,2^30) will fail). We do not check on these values because that would slow down drawing. A constant in the library that returns the maximum size of drawable objects would be a good idea however. 

Greetings,
Peter Achten