GDI+中的BUG:Rect和RectF中的IntersectsWith()函数实现错误

来源:互联网 发布:mac 文件夹没有权限 编辑:程序博客网 时间:2024/06/05 22:35

原代码为:

    BOOL IntersectsWith(IN const Rect& rect) const
    {
        return (GetLeft() < rect.GetRight() &&
                GetTop() < rect.GetTop() &&
                GetRight() > rect.GetLeft() &&
                GetBottom() > rect.GetTop());
    }
但实际情况应该是:

    BOOL IntersectsWith(IN const Rect& rect) const
    {
        return (GetLeft() < rect.GetRight() &&
                GetTop() < rect.GetBottom() &&
                GetRight() > rect.GetLeft() &&
                GetBottom() > rect.GetTop());
    }
请各位大侠指正