diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index aa7c223ab..c17dbb794 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -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();