From ebc3ccba125eb1b45add5783c36eaec7e96ad498 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 8 Nov 2016 22:00:08 +0100 Subject: [PATCH] moviebrowser: simplify channellogo scaling code Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1590f4a276fdb7bf7ba430e34dc0e6a87e4c0422 Author: vanhofen Date: 2016-11-08 (Tue, 08 Nov 2016) Origin message was: ------------------ - moviebrowser: simplify channellogo scaling code ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index b7226229f..fca906cde 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1307,13 +1307,10 @@ void CMovieBrowser::refreshChannelLogo(void) if (m_channelLogo && m_channelLogo->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 = m_channelLogo->getHeight(); - if (h_logo > h_logo_max) - { - m_channelLogo->setWidth(0); // force recalculation + // TODO: move into an own handler, eg. header, so channel logo should be paint in header object + m_channelLogo->setWidth(min(m_channelLogo->getWidth(), w_logo_max), true); + if (m_channelLogo->getHeight() > h_logo_max) m_channelLogo->setHeight(h_logo_max, true); - } int x = m_cBoxFrame.iX + m_cBoxFrameTitleRel.iX + m_cBoxFrameTitleRel.iWidth - m_channelLogo->getWidth() - OFFSET_INNER_MID; int y = m_cBoxFrame.iY + m_cBoxFrameTitleRel.iY + (m_cBoxFrameTitleRel.iHeight - m_channelLogo->getHeight())/2;