* CComponentsItem::paintInit(): Corrected calculation of sw_cur

- Summarized calculate the values of shadow box
This commit is contained in:
Michael Liebmann
2013-05-22 21:31:42 +02:00
parent ad7bb42fc6
commit b1c7c7a34c

View File

@@ -67,7 +67,6 @@ void CComponentsItem::paintInit(bool do_save_bg)
{ {
clear(); clear();
int sw = shadow ? shadow_w : 0;
int th = fr_thickness; int th = fr_thickness;
fb_pixel_t col_frame_cur = col_frame; fb_pixel_t col_frame_cur = col_frame;
@@ -80,15 +79,21 @@ void CComponentsItem::paintInit(bool do_save_bg)
//calculate current needed corner radius for body box, depends of frame thickness //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 sw = 0, sw_cur = 0;
int x_sh = corner_rad>0 ? x+width-2*corner_rad+sw : x+width; //right int x_sh = x + width;
int y_sh = corner_rad>0 ? y+height-2*corner_rad+sw : y+height; //bottom int y_sh = y + height;
if (shadow) {
//calculate current shadow width depends of current corner_rad sw = shadow_w;
int sw_cur = sw; sw_cur = sw;
if (shadow) if (corner_type && corner_rad) {
sw_cur = corner_rad>sw ? 2*corner_rad : sw; //calculate positon of shadow areas
x_sh += sw - 2*corner_rad;
y_sh += sw - 2*corner_rad;
//calculate current shadow width depends of current corner_rad
sw_cur = max(2*corner_rad, sw);
}
}
comp_fbdata_t fbdata[] = comp_fbdata_t fbdata[] =
{ {
{CC_FBDATA_TYPE_BGSCREEN, x, y, width+sw, height+sw, 0, 0, 0, NULL, NULL}, {CC_FBDATA_TYPE_BGSCREEN, x, y, width+sw, height+sw, 0, 0, 0, NULL, NULL},