Algorithm for check how much two rectangles intersect in the X axis
I need an algorithm to calculate how much two 2D rectangles intersect if their Y positions are the same. I'm comparing several rectangles that might all intersect, and I'd like to pick the one that intersects the most, any help is appreciated