in reply to Detecting control placement constraints in dialog resources - rectangle overlap checking
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.
|
|---|