Mail Archives: djgpp/1999/11/11/12:31:35
If you can get hold of the sources for X11 then try look in file
"mit/lib/X/XRegion.c" (true for X11.R5 at least).
Perhaps you don't need the "region" abstraction, but the "box" routines may
be what you are looking for.
Regards,
Kurt Alstrup
-----Original Message-----
From: Alan McFarlane [mailto:amcfarlane AT bigfoot DOT com]
Sent: Thursday, November 11, 1999 8:55 AM
To: djgpp AT delorie DOT com
Subject: [Q] Clipping & Overlapping Rectangles Algorithm
I'm looking for a set of algorithms to do with rectangles having the
following structure:
typedef struct
{
int x, y, w, h;
}
RECT;
1) How to determine if one rectangle encloses another
2) How to determine if one rectangle overlaps another
3) Assuming an overlap, how to create a series of smaller rectangles that
would cover the same area with no overlaps
Cheers
--
Alan McFarlane
amcfarlane AT bigfoot DOT com
- Raw text -