提交 2e591475 编写于 作者: I iamyhw@gmail.com

fix,In region judage two rectangular intersect,Missing cross.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1352 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 967f6f6e
......@@ -114,6 +114,13 @@ static rtgui_region_status_t rtgui_break(rtgui_region_t *pReg);
((r1)->y1 <= (r2)->y1) && \
((r1)->y2 >= (r2)->y2) )
/* true iff Box r1 and Box r2 constitute cross */
#define CROSS(r1,r2) \
( ((r1)->x1 <= (r2)->x1) && \
((r1)->x2 >= (r2)->x2) && \
((r1)->y1 >= (r2)->y1) && \
((r1)->y2 <= (r2)->y2) )
#define allocData(n) rtgui_malloc(PIXREGION_SZOF(n))
#define freeData(reg) if ((reg)->data && (reg)->data->size) rtgui_free((reg)->data)
......@@ -2236,6 +2243,14 @@ int rtgui_rect_is_intersect(const rtgui_rect_t *rect1, const rtgui_rect_t *rect2
{
return RT_EOK;
}
else if (CROSS(rect1,rect2))
{
return RT_EOK;
}
else if (CROSS(rect2,rect1))
{
return RT_EOK;
}
return -RT_ERROR;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册