Message-ID: <2711935EBF71D111AC4200A0C96B51310531FC70@fmsmsx35-3.fm.intel.com> From: "Alstrup, Kurt" To: "'djgpp AT delorie DOT com'" Subject: RE: [Q] Clipping & Overlapping Rectangles Algorithm Date: Thu, 11 Nov 1999 09:16:40 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" Reply-To: djgpp AT delorie DOT com 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