mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
CComponents: use paintBoxRel() only in kill()
paintBackgroundBoxRel() ignores rounded corners. This avoids painting of undesirable parts on corners.
This commit is contained in:
@@ -228,13 +228,20 @@ inline void CComponents::hide()
|
||||
}
|
||||
|
||||
//erase or paint over rendered objects
|
||||
void CComponents::kill(const fb_pixel_t& bg_color)
|
||||
void CComponents::kill(const fb_pixel_t& bg_color, const int& corner_radius)
|
||||
{
|
||||
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);
|
||||
#if 0
|
||||
if (bg_color != COL_BACKGROUND)
|
||||
#endif
|
||||
int r = v_fbdata[i].r;
|
||||
if (corner_radius > -1)
|
||||
r = corner_radius;
|
||||
frameBuffer->paintBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, bg_color, r, corner_type);
|
||||
#if 0
|
||||
else
|
||||
frameBuffer->paintBackgroundBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy);
|
||||
#endif
|
||||
}
|
||||
clearFbData();
|
||||
firstPaint = true;
|
||||
|
@@ -204,7 +204,7 @@ class CComponents
|
||||
|
||||
///erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known
|
||||
///from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND (empty background)
|
||||
virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND);
|
||||
virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND, const int& corner_radius = -1);
|
||||
|
||||
///returns paint mode, true=item was painted
|
||||
virtual bool isPainted(){return is_painted;}
|
||||
|
@@ -138,12 +138,12 @@ void CComponentsItem::hide(bool no_restore)
|
||||
void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent)
|
||||
{
|
||||
if(cc_parent == NULL){
|
||||
CComponents::kill(bg_color);
|
||||
CComponents::kill(bg_color, this->corner_rad);
|
||||
}else{
|
||||
if(ignore_parent)
|
||||
CComponents::kill(bg_color);
|
||||
CComponents::kill(bg_color, this->corner_rad);
|
||||
else
|
||||
CComponents::kill(cc_parent->getColorBody());
|
||||
CComponents::kill(cc_parent->getColorBody(), cc_parent->getCornerRadius());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user