OverlapRect改动:两个参数对调了。想问问LP,这样真的好吗?
Sphinx304版本的代码:
function OverlapRect(const Rect1, Rect2: TRect): Boolean; begin Result:= (Rect1.Left < Rect2.Right) and (Rect1.Right > Rect2.Left) and (Rect1.Top < Rect2.Bottom) and (Rect1.Bottom > Rect2.Top); end;
PXL的代码:
function OverlapRect(const Rect1, Rect2: TIntRect): Boolean; begin Result := (Rect2.Left < Rect1.Right) and (Rect2.Right > Rect1.Left) and (Rect2.Top < Rect1.Bottom) and (Rect2.Bottom > Rect1.Top); end;
另:提供了IntRect方法和IntRectBDS方法,分别替代原来System.Classes的Bounds和Rect方法。在转换以前代码的时候,不要看到Rect()就直接替换成IntRect(),而是要替换成IntRectBDS()。