📌  相关文章
📜  检查两个矩形是否重叠 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:48.052000             🧑  作者: Mango

代码示例2
// Where left, right, top and bottom are essentially edges

if (a.left >= b.right || a.top >= b.bottom || 
    a.right <= b.left || a.bottom <= b.top)
{
    // no overlap
}
else
{
    // overlap
}