mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +02:00
Correct calculation of the size of logo in list header.
- Function for calculating from infoviewer.cpp to pictureviewer.cpp moved - Correct calculation in channellist.cpp, epgview.cpp and moviebrowser.cpp git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1869 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -510,6 +510,23 @@ bool CPictureViewer::DisplayLogo (uint64_t channel_id, int posx, int posy, int w
|
||||
return ret;
|
||||
}
|
||||
|
||||
void CPictureViewer::rescaleImageDimensions(int *width, int *height, const int max_width, const int max_height, bool upscale)
|
||||
{
|
||||
float aspect;
|
||||
|
||||
if ((!upscale) && (*width <= max_width) && (*height <= max_height))
|
||||
return;
|
||||
|
||||
aspect = (float)(*width) / (float)(*height);
|
||||
if (((float)(*width) / (float)max_width) > ((float)(*height) / (float)max_height)) {
|
||||
*width = max_width;
|
||||
*height = (int)(max_width / aspect);
|
||||
}else{
|
||||
*height = max_height;
|
||||
*width = (int)(max_height * aspect);
|
||||
}
|
||||
}
|
||||
|
||||
bool CPictureViewer::DisplayImage (const std::string & name, int posx, int posy, int width, int height)
|
||||
{
|
||||
/* TODO: cache or check for same */
|
||||
|
Reference in New Issue
Block a user