In the following, the graphic "test" is a rectangle.

  set the rect of graphic "test" to "0,0,2,2"
  -- Four pixels black: (0,0), (0,1), (1,0), (1,1)

There are two equivalent ways to interpret this:

a) The bottom-right point of the rect is the first *not-included* 
   point in the drawn rectangle. This is awkward because it means
   the points of the rect are not the same as the points of the
   rectangle.

b) We're using the QuickDraw model, where the coords specify the 
   infinitely thin lines *between* pixels, so the rect (0,0,2,2) 
   encloses exactly four pixels. Much better. Life should always
   be so clear.

Either of these is OK, but should be spelled out in the Dictionary.

Anyway, all programmers should be used to off-by-one issues, and
closed vs. half-open intervals. But consider the following. Graphic
"test" is now a line.

  set the points of graphic "test" to "0,0" & return & "2,2"
  -- Pixels (0,0) and (1,1) are set: again, non-inclusive.

This might make sense if we say that the "points" property also
specifies boundaries via one of the (*) definitions above. BUT...I
really think that if a point [e.g. (2,2)] is in "the points" is should
be one of the points. 

  get the rect of graphic "test"  
  -- returns "-1,-1,3,3"

Why not "0,0,2,2"? Using the QuickDraw model, that would make sense: a
rect that exactly encloses the graphic. Using the other model [a)
above], the best I can come up with is: 

  The rect of the graphic is a rect which, if you use it as the 
  rect of a rectangle, would draw a black line around the graphic
  without touching any of the graphic's drawn points.

Note that in this case we have to distinguish both between a rectangle
and its rect, and between the "points" property of a graphic and its
actual drawn points. This is doubly awkward. 

Is there an authoritative definition of the rect of a graphic?

Andrew
[EMAIL PROTECTED]

Reply via email to