Hello there. I had the need to generate the insertion of two rectangles. Here is the code I used. You may be interested in adding this code (or a better optimized one) in the RUDL codebase.
return nil if orect==nil || !overlaps?(orect)
nx=(x>orect.x) ? x : orect.x
ny=(y>orect.y) ? y : orect.y
nxt=(x+w<orect.x+orect.w) ? x+w : orect.x+orect.w
nyt=(y+h<orect.y+orect.h) ? y+h : orect.y+orect.h
Log in to post a comment.