OverlapRect改動:兩個參數對調了。想問問LP,這樣真的好嗎?spa
Sphinx304版本的代碼:code
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的代碼:blog
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()。io