Board index » delphi » Detecting overlapping rectangles

Detecting overlapping rectangles

Could someone please suggest to me the best way of detecting whether two
rectangles (TRect structures) overlap? Many thanks.

Alan Hale

 

Re:Detecting overlapping rectangles


Quote
In article <38BC4448.E341...@clara.net>, Alan Hale <adh...@clara.net> wrote:
>Could someone please suggest to me the best way of detecting whether two
>rectangles (TRect structures) overlap? Many thanks.

I did it using IntersectRect. If the result of that function is any empty
rectangle, the two don't overlap.

An empty rectangle, by the way, can be determined using IsRectEmpty.

HTH,
Mab

|~\  /~| /~~| |~|   The .sig wears a ring of polymorph! --More--
|  \/  |/ / |_| |__ The .login hits! The .cshrc bites!
|      ' /| |_| | / ____________________________________________
| |\/|  /\  | |  /  Official member of STI:
| |  |_/  \_| | /       The Search for Terrestrial Intelligence!
-\|-----------|/------------------------------------------------
=================== http://members.dingoblue.net.au/~mabster ===

Other Threads