mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 23:42:51 +02:00
CComponents: Reworked paint the shadows
- Paint rounded corners only where it is required
- Skip paint frame/paint shadow, if not defined
Origin commit data
------------------
Branch: ni/coolstream
Commit: 4da83b546c
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2013-05-24 (Fri, 24 May 2013)
Origin message was:
------------------
* CComponents: Reworked paint the shadows
- Paint rounded corners only where it is required
- Skip paint frame/paint shadow, if not defined
------------------
This commit was generated by Migit
This commit is contained in:
@@ -133,6 +133,25 @@ void CComponents::paintFbItems(bool do_save_bg)
|
||||
}
|
||||
else if (fbtype == CC_FBDATA_TYPE_BACKGROUND)
|
||||
frameBuffer->paintBackgroundBoxRel(x, y, v_fbdata[i].dx, v_fbdata[i].dy);
|
||||
else if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX) {
|
||||
if (shadow) {
|
||||
int sw = shadow_w;
|
||||
int sw_cur = sw;
|
||||
int x_sh = v_fbdata[i].x + v_fbdata[i].dx - sw;
|
||||
int y_sh = v_fbdata[i].y + v_fbdata[i].dy - sw;
|
||||
if (corner_type && v_fbdata[i].r) {
|
||||
//calculate positon of shadow areas
|
||||
x_sh += sw - 2*v_fbdata[i].r;
|
||||
y_sh += sw - 2*v_fbdata[i].r;
|
||||
//calculate current shadow width depends of current corner_rad
|
||||
sw_cur = max(2*v_fbdata[i].r, sw);
|
||||
}
|
||||
// shadow right
|
||||
frameBuffer->paintBoxRel(x_sh, v_fbdata[i].y, sw_cur, v_fbdata[i].dy-sw_cur, v_fbdata[i].color, v_fbdata[i].r, corner_type & CORNER_TOP_RIGHT);
|
||||
// shadow bottom
|
||||
frameBuffer->paintBoxRel(v_fbdata[i].x, y_sh, v_fbdata[i].dx, sw_cur, v_fbdata[i].color, v_fbdata[i].r, corner_type & CORNER_BOTTOM);
|
||||
}
|
||||
}
|
||||
else
|
||||
frameBuffer->paintBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].color, v_fbdata[i].r, corner_type);
|
||||
}
|
||||
|
Reference in New Issue
Block a user