mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
CChannelList: fix and simplify paint of custom channellogos
paint was probably broken since 5e380fa4f8
This commit is contained in:
@@ -1664,7 +1664,7 @@ void CChannelList::paintAdditionals(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void CChannelList::showChannelLogo()
|
||||
void CChannelList::showChannelLogo() //TODO: move into an own handler, eg. header, channel logo should be paint inside header object
|
||||
{
|
||||
if ((*chanlist).empty())
|
||||
return;
|
||||
@@ -1680,13 +1680,9 @@ void CChannelList::showChannelLogo()
|
||||
CChannelLogo = new CComponentsChannelLogoScalable(0, 0, (*chanlist)[selected]->getName(), (*chanlist)[selected]->getChannelID());
|
||||
|
||||
if (CChannelLogo->hasLogo()){
|
||||
int h_logo = CChannelLogo->getHeight();
|
||||
if (h_logo > theight){ //scale image if required, TODO: move into an own handler, eg. header, so channel logo should be paint in header object
|
||||
uint8_t h_ratio = uint8_t(theight*100/h_logo);
|
||||
CChannelLogo->setHeight(theight);
|
||||
int w_logo = h_ratio*CChannelLogo->getWidth()/100;
|
||||
CChannelLogo->setWidth(min(w_logo, logo_w_max));
|
||||
}
|
||||
CChannelLogo->setWidth(min(CChannelLogo->getWidth(), logo_w_max), true);
|
||||
if (CChannelLogo->getHeight() > theight) //scale image if required
|
||||
CChannelLogo->setHeight(theight, true);
|
||||
CChannelLogo->setXPos(x + full_width - logo_off - CChannelLogo->getWidth());
|
||||
CChannelLogo->setYPos(y + (theight - CChannelLogo->getHeight()) / 2);
|
||||
CChannelLogo->paint();
|
||||
|
Reference in New Issue
Block a user