mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 10:21:10 +02:00
CChannelList/CNeutrinoEventList/CMovieBrowser: fix logo scale
Downscale was broken.
This commit is contained in:
@@ -1259,15 +1259,22 @@ void CMovieBrowser::refreshMovieInfo(void)
|
||||
CChannelLogo = NULL;
|
||||
}
|
||||
if (old_EpgId != m_movieSelectionHandler->epgEpgId >>16) {
|
||||
CChannelLogo = new CComponentsChannelLogo(0, 0, logo_w_max, m_cBoxFrameTitleRel.iHeight,
|
||||
m_movieSelectionHandler->epgChannel, m_movieSelectionHandler->epgEpgId >>16);
|
||||
CChannelLogo = new CComponentsChannelLogo(0, 0, m_movieSelectionHandler->epgChannel, m_movieSelectionHandler->epgEpgId >>16);
|
||||
old_EpgId = m_movieSelectionHandler->epgEpgId >>16;
|
||||
}
|
||||
|
||||
if (CChannelLogo && CChannelLogo->hasLogo()) {
|
||||
//scale image if required, TODO: move into an own handler, eg. header, so channel logo should be paint in header object
|
||||
int h_logo = CChannelLogo->getHeight();
|
||||
if (h_logo > m_cBoxFrameTitleRel.iHeight){
|
||||
uint8_t ratio = m_cBoxFrameTitleRel.iHeight*100/h_logo;
|
||||
CChannelLogo->setHeight(m_cBoxFrameTitleRel.iHeight);
|
||||
int w_logo = ratio*CChannelLogo->getWidth()/100;
|
||||
CChannelLogo->setWidth(min(w_logo, logo_w_max));
|
||||
}
|
||||
|
||||
lx = m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-CChannelLogo->getWidth()-10;
|
||||
ly = m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-CChannelLogo->getHeight())/2;
|
||||
CChannelLogo->doScale(m_cBoxFrameTitleRel.iHeight < CChannelLogo->getHeight());
|
||||
CChannelLogo->setXPos(lx - pb_hdd_offset);
|
||||
CChannelLogo->setYPos(ly);
|
||||
CChannelLogo->paint();
|
||||
|
Reference in New Issue
Block a user