From d18217effb3158b83a9f02197966a35e24adeffd Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 4 Apr 2013 12:19:31 +0200 Subject: [PATCH] CComponents: don't paint the same box with different colors as background --- src/gui/components/cc.h | 1 + src/gui/components/cc_base.cpp | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index cd064ab97..55a8418a6 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -45,6 +45,7 @@ class CComponents bool firstPaint, shadow, is_painted, paint_bg; void initVarBasic(); + bool allowPaint(int i); void paintFbItems(bool do_save_bg = true); virtual fb_pixel_t* getScreen(int ax, int ay, int dx, int dy); comp_screen_data_t saved_screen; diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index 313c29635..6872023f8 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -78,6 +78,24 @@ void CComponents::initVarBasic() saved_screen.pixbuf = NULL; } +bool CComponents::allowPaint(int i) +{ + if(v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BOX) + return true; + + + if (v_fbdata[CC_FBDATA_TYPE_BOX].x != v_fbdata[i].x) + return true; + else if (v_fbdata[CC_FBDATA_TYPE_BOX].y != v_fbdata[i].y) + return true; + else if (v_fbdata[CC_FBDATA_TYPE_BOX].dx != v_fbdata[i].dx) + return true; + else if (v_fbdata[CC_FBDATA_TYPE_BOX].dy != v_fbdata[i].dy) + return true; + + return false; +} + //paint framebuffer stuff and fill buffer void CComponents::paintFbItems(bool do_save_bg) { @@ -120,7 +138,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 + else if( allowPaint(i) ) 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); } }