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.


Origin commit data
------------------
Branch: ni/coolstream
Commit: 6a2e701a7a
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-05-05 (Mon, 05 May 2014)



------------------
This commit was generated by Migit
This commit is contained in:
2014-05-05 18:52:21 +02:00
parent ad2195b4e2
commit 83ee5b6646
3 changed files with 34 additions and 6 deletions

View File

@@ -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;