改为公用函数

This commit is contained in:
Liu Chao
2014-05-03 16:46:34 +08:00
parent 197b8752cc
commit fae944e695
2 changed files with 19 additions and 16 deletions
+17
View File
@@ -58,6 +58,23 @@ LCUI_API void LCUIRect_ValidateArea( LCUI_Rect *rect, LCUI_Size box_size );
/** 检测矩形是否遮盖另一个矩形 */
LCUI_API LCUI_BOOL LCUIRect_IsCoverRect( LCUI_Rect rect1, LCUI_Rect rect2 );
/**
* 根据重叠矩形 rect1,将矩形 rect2 分割成四个矩形
* 分割方法如下:
* ┏━━┳━━━━━━┓
* ┃ ┃ 3 ┃
* ┃ 0 ┣━━━┳━━┃
* ┃ ┃rect1 ┃ ┃
* ┃ ┃ ┃ 2 ┃
* ┣━━┻━━━┫ ┃
* ┃ 1 ┃ ┃
* ┗━━━━━━┻━━┛
*
* rect2 必须被 rect1 完全包含
*/
LCUI_API void LCUIRect_CutFourRect( LCUI_Rect *rect1, LCUI_Rect *rect2,
LCUI_Rect rects[4] );
/** 初始化脏矩形记录 */
LCUI_API void DirtyRectList_Init( LCUI_DirtyRectList *list );
+2 -16
View File
@@ -202,22 +202,8 @@ static void LCUIRect_MergeRect( LCUI_Rect *big, LCUI_Rect *a, LCUI_Rect *b )
}
}
/**
* 根据重叠矩形 rect1,将矩形 rect2 分割成四个矩形
* 分割方法如下:
* ┏━━┳━━━━━━┓
* ┃ ┃ 3 ┃
* ┃ 0 ┣━━━┳━━┃
* ┃ ┃rect1 ┃ ┃
* ┃ ┃ ┃ 2 ┃
* ┣━━┻━━━┫ ┃
* ┃ 1 ┃ ┃
* ┗━━━━━━┻━━┛
*
* rect2 必须被 rect1 完全包含
*/
static void LCUIRect_CutFourRect( LCUI_Rect *rect1, LCUI_Rect *rect2,
LCUI_Rect rects[4] )
LCUI_API void LCUIRect_CutFourRect( LCUI_Rect *rect1, LCUI_Rect *rect2,
LCUI_Rect rects[4] )
{
rects[0].x = rect2->x;
rects[0].y = rect2->y;