From cf52c972db30a8cc89c5cff2768e68ffa844a458 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 2 Jun 2013 21:33:26 +0200 Subject: [PATCH] menu: fix artifacts on page change Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0ad51e79646f95f863ad5aeb7ad84923ec9df7ed Author: Stefan Seyfried Date: 2013-06-02 (Sun, 02 Jun 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 506448c7b..68ddcb19f 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -849,8 +849,8 @@ void CMenuWidget::calcSize() total_pages++; heightCurrPage=item_height; } - if(total_pages == 1) - itemHeightTotal+=item_height; + if (heightCurrPage > itemHeightTotal) + itemHeightTotal = heightCurrPage; } page_start.push_back(items.size()); @@ -987,9 +987,9 @@ void CMenuWidget::paintItems() int item_height=height-(item_start_y-y); frameBuffer->paintBoxRel(x+ width,item_start_y, 15, item_height, COL_MENUCONTENT_PLUS_1, RADIUS_MIN); frameBuffer->paintBoxRel(x+ width +2, item_start_y+ 2+ current_page*(item_height-4)/total_pages, 11, (item_height-4)/total_pages, COL_MENUCONTENT_PLUS_3, RADIUS_MIN); - if((current_page==total_pages-1) || (current_page == 0 && RADIUS_MIN)){ - frameBuffer->paintBoxRel(x,item_start_y, width,item_height, COL_MENUCONTENT_PLUS_0); - } + /* background of menu items, paint every time because different items can have + * different height and this might leave artifacts otherwise after changing pages */ + frameBuffer->paintBoxRel(x,item_start_y, width,item_height, COL_MENUCONTENT_PLUS_0); } int ypos=item_start_y; for (int count = 0; count < (int)items.size(); count++)