From edd4f121cd1cbbbcc1cf5184150bfa82cddeb8a4 Mon Sep 17 00:00:00 2001 From: Liu Chao Date: Thu, 8 May 2014 23:45:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A0=E6=AD=A3=E9=98=B4=E5=BD=B1=E7=BB=98?= =?UTF-8?q?=E5=88=B6=E6=97=B6=E7=9A=84=E5=9D=90=E6=A0=87=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/draw/boxshadow.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/draw/boxshadow.c b/src/draw/boxshadow.c index 31ff005c..1867fa9c 100644 --- a/src/draw/boxshadow.c +++ b/src/draw/boxshadow.c @@ -159,7 +159,6 @@ draw_circle( LCUI_Graph *graph, LCUI_Pos center, int r, LCUI_ARGB color ) circle_left = center.x - r; circle_bottom = center.y + r; circle_top = center.y - r; - for( pos.x=circle_left; pos.xw - shadow.size; - pos.y = shadow.size; - bound.x = pos.x - shadow.size; + pos.x = BoxShadow_GetX( &shadow ) + shadow.size; + pos.x += BoxShadow_GetBoxWidth( &shadow, graph->w ); + pos.y = BoxShadow_GetY( &shadow ) + shadow.size; + bound.x = pos.x; bound.y = 0; bound.w = bound.h = shadow.size; Graph_Quote( &box, graph, bound ); + Graph_FillAlpha( &box, 0 ); draw_circle( &box, pos, shadow.size, shadow.top_color ); } @@ -245,12 +247,14 @@ Graph_DrawBottomLeftShadow( LCUI_Graph *graph, LCUI_Rect area, LCUI_Rect bound; LCUI_Pos pos; - pos.x = shadow.size; - pos.y = graph->h - shadow.size; - bound.x = 0; - bound.y = pos.y - shadow.size; + pos.x = BoxShadow_GetX( &shadow ) + shadow.size; + pos.y = BoxShadow_GetY( &shadow ) + shadow.size; + pos.y += BoxShadow_GetBoxHeight( &shadow, graph->h ); + bound.x = pos.x - shadow.size; + bound.y = pos.y; bound.w = bound.h = shadow.size; Graph_Quote( &box, graph, bound ); + Graph_FillAlpha( &box, 0 ); draw_circle( &box, pos, shadow.size, shadow.bottom_color ); } @@ -262,12 +266,15 @@ Graph_DrawBottomRightShadow( LCUI_Graph *graph, LCUI_Rect area, LCUI_Rect bound; LCUI_Pos pos; - pos.x = graph->w - shadow.size; - pos.y = graph->h - shadow.size; - bound.x = pos.x - shadow.size; - bound.y = pos.y - shadow.size; + pos.x = BoxShadow_GetX( &shadow ) + shadow.size; + pos.x += BoxShadow_GetBoxWidth( &shadow, graph->w ); + pos.y = BoxShadow_GetY( &shadow ) + shadow.size; + pos.y += BoxShadow_GetBoxHeight( &shadow, graph->h ); + bound.x = pos.x; + bound.y = pos.y; bound.w = bound.h = shadow.size; Graph_Quote( &box, graph, bound ); + Graph_FillAlpha( &box, 0 ); draw_circle( &box, pos, shadow.size, shadow.bottom_color ); }