CComponents: rework kill()

There was some problems with restore, hide, clean and save background of item parts,
seen in detailsline. kill() worked not really clean.
kill() works now as virtual member and uses paintBackgroundBoxRel().

In consequence of which:
-unnecessary members in subclasses removed.
-add some comments
This commit is contained in:
2013-05-03 19:51:57 +02:00
parent 4bf2a4aa19
commit a4c3e08f77
4 changed files with 25 additions and 51 deletions

View File

@@ -140,7 +140,7 @@ void CComponents::paintFbItems(bool do_save_bg)
frameBuffer->paintBoxFrame(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].frame_thickness, v_fbdata[i].color, v_fbdata[i].r);
else if (fbtype == CC_FBDATA_TYPE_BACKGROUND)
frameBuffer->paintBackgroundBoxRel(x, y, v_fbdata[i].dx, v_fbdata[i].dy);
else if( allowPaint(i) )
else if( allowPaint(i) || fbtype == CC_FBDATA_TYPE_LINE)
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);
}
}
@@ -170,6 +170,16 @@ inline void CComponents::hide()
is_painted = false;
}
//erase rendered objects
void CComponents::kill()
{
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);
clear();
firstPaint = true;
is_painted = false;
}
//clean old screen buffer
inline void CComponents::clear()
{