I'm not aware on any modules that are readily available for this, but you could either abuse one of the many imaging modules to do it, by actually painting your bounding boxes into an image (using the "add" function) and then scanning that image for a colour value larger than 1.

Another, not too hard way would be to do the checking of the bounding boxes yourself. I have some bounding box code hidden in Banish the overlap (was:Re: drawmap.pl - Spot The Monk!) somewhere. Basically there are two kinds of overlap:

1) 2) aaaaaaa aa aaaaaaa aa aaaaabbbb bbbbbbbb aaaaabbbb aa bbbb aa

... that is, either one of the corners of one rectangle is contained in the other rectangle, or they intersect otherwise. You can reduce the second case to the first by shrinking the rectangle by moving an outlier corner to line up with one side of the other rectangle.


In reply to Re: Detecting control placement constraints in dialog resources - rectangle overlap checking by Corion
in thread Detecting control placement constraints in dialog resources - rectangle overlap checking by GrandFather

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.