mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +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
Origin commit data
------------------
Commit: 4f4f46a912
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2011-11-22 (Tue, 22 Nov 2011)
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