vc 如何判断2个矩形是否有交集

1)

typedef struct rec_{

long top;

long left;

 long bottom;

long right;

}rec;

BOOL RectOverlap(const rec *rA, const rec *rB){

 if (!(rA.bottom < rB.top || rA.top > rB.bottom) && !(rA.right < rB.left || rA.left > rB.right))

 return TRUE;

return FALSE;

};

你可能感兴趣的:(struct)