mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
CComponents/CComponentsItem: add advanced version of kill()
kill() allows now paint with defined colors over rendered objects without restore of background. It's similar to paintBackgroundBoxRel() known from CFrameBuffer, but with possiblity to define color, default color is 0 like before (empty background). Items with parent bindings use the background color of its parent as default, but can also be ignored. This function can be useful before repaint of items and/or, if required, to have a clean background inside item containers.
This commit is contained in:
@@ -227,11 +227,15 @@ inline void CComponents::hide()
|
||||
is_painted = false;
|
||||
}
|
||||
|
||||
//erase rendered objects
|
||||
void CComponents::kill()
|
||||
//erase or paint over rendered objects
|
||||
void CComponents::kill(const fb_pixel_t& bg_color)
|
||||
{
|
||||
for(size_t i =0; i< v_fbdata.size() ;i++)
|
||||
frameBuffer->paintBackgroundBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy);
|
||||
for(size_t i =0; i< v_fbdata.size() ;i++){
|
||||
if (bg_color)
|
||||
frameBuffer->paintBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, bg_color, v_fbdata[i].r, corner_type);
|
||||
else
|
||||
frameBuffer->paintBackgroundBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy);
|
||||
}
|
||||
clearFbData();
|
||||
firstPaint = true;
|
||||
is_painted = false;
|
||||
|
Reference in New Issue
Block a user