首页 > Web开发 > 详细

【Asphyre引擎】关于AsphyreTypes中OverlapRect的改动,都是泪啊!!!

时间:2015-11-10 23:43:15      阅读:226      评论:0      收藏:0      [点我收藏+]

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()。

【Asphyre引擎】关于AsphyreTypes中OverlapRect的改动,都是泪啊!!!

原文:http://www.cnblogs.com/crymm/p/4954856.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!