CComponentsItem: don't render shadow as full box

This commit is contained in:
2013-04-20 22:43:24 +02:00
parent 4a5044ca46
commit 48c4142a24

View File

@@ -81,14 +81,22 @@ void CComponentsItem::paintInit(bool do_save_bg)
}
//calculate current needed corner radius for body box, depends of frame thickness
int rad = (corner_rad>th) ? corner_rad-th : corner_rad;
int rad = (corner_rad>th) ? corner_rad-th : corner_rad;
//calculate positon of shadow areas
int x_sh = corner_rad>0 ? x+width-2*corner_rad+sw : x+width; //right
int y_sh = corner_rad>0 ? y+height-2*corner_rad+sw : y+height; //bottom
//calculate current shadow width depends of current corner_rad
int sw_cur = corner_rad>0 ? 2*corner_rad : sw;
comp_fbdata_t fbdata[] =
{
{CC_FBDATA_TYPE_BGSCREEN, x, y, width+sw, height+sw, 0, 0, 0, NULL, NULL},
{CC_FBDATA_TYPE_SHADOW, x+sw, y+sw, width, height, col_shadow, corner_rad, 0, NULL, NULL},
{CC_FBDATA_TYPE_FRAME, x, y, width, height, col_frame_cur, corner_rad, th, NULL, NULL},
{CC_FBDATA_TYPE_BOX, x+th, y+th, width-2*th, height-2*th, col_body, rad, 0, NULL, NULL},
{CC_FBDATA_TYPE_BGSCREEN, x, y, width+sw, height+sw, 0, 0, 0, NULL, NULL},
{CC_FBDATA_TYPE_BOX, x_sh, y+sw, sw_cur, height, col_shadow, corner_rad, 0, NULL, NULL},//shadow right
{CC_FBDATA_TYPE_BOX, x+sw, y_sh, width, sw_cur, col_shadow, corner_rad, 0, NULL, NULL},//shadow bottom
{CC_FBDATA_TYPE_FRAME, x, y, width, height, col_frame_cur, corner_rad, th, NULL, NULL},//frame
{CC_FBDATA_TYPE_BOX, x+th, y+th, width-2*th, height-2*th, col_body, rad, 0, NULL, NULL},//body
};
for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++)