I'm working on finding maximum overlap rectangle.
I've tried using following lines of code but it returns with that rectangle is overlaping to other or not
public boolean isOverlapping(Rect r1, Rect r2) {
if (r1.top < r2.top || r1.left > r2.left) {
return false;
}
if (r1.width() < r2.width() || r1.height() > r2.height()) {
return false;
}
return true;
}
I expect output that rectangle 3 is most overlaping to given rectangle. Not list or number of rectangles that overlaping to given rectangle.