From f3bc754dd4a2dfeac8437dbef35e89ecd61cb2bb Mon Sep 17 00:00:00 2001 From: Liu Chao Date: Sat, 1 Jun 2013 11:09:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=BC=A0=E6=A0=87=E5=85=89?= =?UTF-8?q?=E6=A0=87=E7=9A=84=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/LCUI_Cursor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/LCUI_Cursor.c b/src/LCUI_Cursor.c index 6685a288..fa109a92 100755 --- a/src/LCUI_Cursor.c +++ b/src/LCUI_Cursor.c @@ -48,7 +48,7 @@ #include LC_MISC_H #include LC_RES_H -struct LCUI_Cursor { +static struct LCUI_Cursor { LCUI_Pos current_pos; /* 当前的坐标 */ LCUI_Pos new_pos; /* 将要更新的坐标 */ int visible; /* 是否可见 */ @@ -60,6 +60,7 @@ void LCUIModule_Cursor_Init( void ) { LCUI_Graph pic; Graph_Init( &pic ); + Graph_Init( &cursor.graph ); /* 载入自带的游标的图形数据 */ Load_Graph_Default_Cursor( &pic ); LCUICursor_SetGraph( &pic ); @@ -145,6 +146,9 @@ LCUI_API int LCUICursor_SetGraph( LCUI_Graph *graph ) { if (Graph_IsValid (graph)) { + if( Graph_IsValid(&cursor.graph) ) { + Graph_Free( &cursor.graph ); + } Graph_Copy( &cursor.graph, graph ); LCUICursor_Refresh(); return 0;