[OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

Paul Dupuis paul at researchware.com
Tue Feb 16 12:08:45 EST 2021


On 2/16/2021 6:16 AM, David V Glasgow via use-livecode wrote:
> Being a bear of little brain, I would try placing each rect into a group centred on a larger rect, where the margin is d/2,  then test using intersect.
>
> Now, where did I put that hunny?
>
>

Like the pooh reference!

Although I am not sure I follow exactly what you are suggests - AND - I 
need to do this via math rather than visible (or invisible) objects in LC.

for rects r1,r2, I have l1,t1,r1,b2 and l2,t2,r2,b2 for their 
coordinates. The rect min(l1,l2),min(t1,t2),max(r1,r2),max(b1,b2) is a 
rectangle that exactly bounds both rects - this would be the rect of the 
group (if you created them as objects and grouped them (less 
margins/borders).

I don't follow the part about 'centered on a larger rect where the 
margin is d/2?





More information about the use-livecode mailing list