[cairo] libpixman - libpixregion, libic and slim merged; cairo built with it

Nathan Hurst Nathan.Hurst at infotech.monash.edu.au
Tue Dec 9 16:38:26 PST 2003


Bill Spitzak wrote:

>Although width/height has a history in X, Mac and Windows users are quite 
>used to the xy-pair (unfortunately they call it left, bottom, right, top, 
>which implies a direction, we must make it clear that these are two points). 
>So this will not alienate as many programmers as you may think.
>  
>
Actually, MacOS(<= 9) represents rectangles explicitly as topleft and 
bottomright corners.  A rectangle with either dimension out of order 
(left > right, e.g.) is defined as empty.  This means that intersection 
and union come down to only comparing each of the pairs of sides (left 
against left).  A separate routine is provided to convert two points 
into a properly normalised rectangle.

This is useful for simplifying inner loop code.  I'm not sure what 
advantage you have by encoding rectangles as any pair of opposite 
corners and I would hesitate to use this form without a good reason (It 
adds quite a bit of work to almost every operation).  Why would you want 
a rectangle to include a winding number?

njh





More information about the cairo mailing list