mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 00:41:09 +02:00
neutrino: avoid float when calculating scrollbars
Origin commit data
------------------
Branch: ni/coolstream
Commit: 37c5f7c7d3
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2011-12-25 (Sun, 25 Dec 2011)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -131,10 +131,9 @@ void CBEBouquetWidget::paint()
|
||||
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
|
||||
|
||||
int sbc= ((Bouquets->size()- 1)/ listmaxshow)+ 1;
|
||||
float sbh= (sb- 4)/ sbc;
|
||||
int sbs= (selected/listmaxshow);
|
||||
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ int(sbs* sbh) , 11, int(sbh), COL_MENUCONTENT_PLUS_3);
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3);
|
||||
}
|
||||
|
||||
void CBEBouquetWidget::paintHead()
|
||||
|
@@ -145,10 +145,9 @@ void CBEChannelWidget::paint()
|
||||
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
|
||||
|
||||
int sbc= ((Channels->size()- 1)/ listmaxshow)+ 1;
|
||||
float sbh= (sb- 4)/ sbc;
|
||||
int sbs= (selected/listmaxshow);
|
||||
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ int(sbs* sbh) , 11, int(sbh), COL_MENUCONTENT_PLUS_3);
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3);
|
||||
}
|
||||
|
||||
void CBEChannelWidget::paintHead()
|
||||
|
@@ -475,9 +475,8 @@ void CBookmarkManager::paint()
|
||||
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
|
||||
|
||||
int sbc= ((bookmarks.size()- 1)/ listmaxshow)+ 1;
|
||||
float sbh= (sb- 4)/ sbc;
|
||||
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ int(page_nr * sbh) , 11, int(sbh), COL_MENUCONTENT_PLUS_3);
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ page_nr * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3);
|
||||
}
|
||||
|
||||
paintFoot();
|
||||
|
@@ -614,8 +614,7 @@ void CBouquetList::paint()
|
||||
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
|
||||
|
||||
int sbc= ((bsize - 1)/ listmaxshow)+ 1;
|
||||
float sbh= (sb - 4)/ sbc;
|
||||
int sbs= (selected/listmaxshow);
|
||||
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ int(sbs* sbh) , 11, int(sbh), COL_MENUCONTENT_PLUS_3);
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3);
|
||||
}
|
||||
|
@@ -1235,11 +1235,10 @@ void EpgPlus::paint()
|
||||
this->frameBuffer->paintBoxRel (this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, COL_MENUCONTENT_PLUS_0);
|
||||
|
||||
int tmp = ((this->channelList->getSize() - 1) / this->maxNumberOfDisplayableEntries) + 1;
|
||||
float sliderKnobHeight = (sliderHeight - 4) / tmp;
|
||||
int sliderKnobPosition = this->selectedChannelEntry == NULL ? 0 : (this->selectedChannelEntry->index / this->maxNumberOfDisplayableEntries);
|
||||
|
||||
this->frameBuffer->paintBoxRel (this->sliderX + 2, this->sliderY + int (sliderKnobPosition * sliderKnobHeight)
|
||||
, this->sliderWidth - 4, int (sliderKnobHeight) , COL_MENUCONTENT_PLUS_3);
|
||||
this->frameBuffer->paintBoxRel(this->sliderX + 2, this->sliderY + sliderKnobPosition * (sliderHeight-4)/tmp
|
||||
, this->sliderWidth - 4, (sliderHeight-4)/tmp, COL_MENUCONTENT_PLUS_3);
|
||||
}
|
||||
|
||||
// -- EPG+ Menue Handler Class
|
||||
|
@@ -857,10 +857,9 @@ void EventList::paint(t_channel_id channel_id)
|
||||
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
|
||||
|
||||
int sbc= ((evtlist.size()- 1)/ listmaxshow)+ 1;
|
||||
float sbh= (sb- 4)/ sbc;
|
||||
int sbs= (selected/listmaxshow);
|
||||
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ int(sbs* sbh) , 11, int(sbh), COL_MENUCONTENT_PLUS_3);
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -697,10 +697,9 @@ void CPictureViewerGui::paint()
|
||||
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
|
||||
|
||||
int sbc= ((playlist.size()- 1)/ listmaxshow)+ 1;
|
||||
float sbh= (sb- 4)/ sbc;
|
||||
int sbs= (selected/listmaxshow);
|
||||
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ int(sbs* sbh) , 11, int(sbh), COL_MENUCONTENT_PLUS_3);
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3);
|
||||
|
||||
paintFoot();
|
||||
paintInfo();
|
||||
|
@@ -343,12 +343,11 @@ void CPluginList::paintItems()
|
||||
// Scrollbar
|
||||
int nrOfPages = ((pluginlist.size()-1) / listmaxshow)+1;
|
||||
int currPage = (liststart/listmaxshow) +1;
|
||||
float blockHeight = (height-theight-4-RADIUS_LARGE)/nrOfPages;
|
||||
|
||||
frameBuffer->paintBoxRel(x, y+theight, width+15, height-theight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);
|
||||
|
||||
frameBuffer->paintBoxRel(x+width, y+theight, 15, height-theight-RADIUS_LARGE, COL_MENUCONTENT_PLUS_1);
|
||||
frameBuffer->paintBoxRel(x+ width +2, y+theight+2+int((currPage-1)*blockHeight) , 11, int(blockHeight), COL_MENUCONTENT_PLUS_3);
|
||||
frameBuffer->paintBoxRel(x+ width +2, y+theight+2+(currPage-1)*(height-theight-4-RADIUS_LARGE)/nrOfPages, 11, (height-theight-4-RADIUS_LARGE)/nrOfPages, COL_MENUCONTENT_PLUS_3);
|
||||
} else
|
||||
frameBuffer->paintBoxRel(x, y+theight, width, height-theight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);
|
||||
|
||||
|
@@ -875,9 +875,8 @@ void CTimerList::paint()
|
||||
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
|
||||
|
||||
int sbc= ((timerlist.size()- 1)/ listmaxshow)+ 1;
|
||||
float sbh= (sb- 4)/ sbc;
|
||||
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ int(page_nr * sbh) , 11, int(sbh), COL_MENUCONTENT_PLUS_3, RADIUS_SMALL);
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ page_nr * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3, RADIUS_SMALL);
|
||||
}
|
||||
|
||||
paintFoot();
|
||||
|
@@ -70,10 +70,9 @@ void CListBox::paint()
|
||||
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
|
||||
|
||||
int sbc= ((getItemCount()- 1)/ listmaxshow)+ 1;
|
||||
float sbh= (sb- 4)/ sbc;
|
||||
int sbs= (selected/listmaxshow);
|
||||
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ int(sbs* sbh) , 11, int(sbh), COL_MENUCONTENT_PLUS_3);
|
||||
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3);
|
||||
}
|
||||
|
||||
void CListBox::paintHead()
|
||||
|
Reference in New Issue
Block a user