summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--headergrid.c10
-rw-r--r--imagecache.c4
-rw-r--r--view.c3
3 files changed, 10 insertions, 7 deletions
diff --git a/headergrid.c b/headergrid.c
index 7b158fe..91a069d 100644
--- a/headergrid.c
+++ b/headergrid.c
@@ -56,7 +56,8 @@ void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
cImage *logo = imgCache.GetLogo(channel);
if (logo) {
const int logoheight = logo->Height();
- pixmapLogo->DrawImage(cPoint(logoX, (Height() - logoheight) / 2), *logo);
+ const int logowidth = logo->Width();
+ pixmapLogo->DrawImage(cPoint(logoX + ((logoWidth - logowidth) / 2), (Height() - logoheight) / 2), *logo);
logoFound = true;
}
}
@@ -81,7 +82,6 @@ void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
// Draw Channel vertical view
void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
- int logoWidth = geoManager.logoWidth;
int logoHeight = geoManager.logoHeight;
cTextWrapper tw;
cString headerText = cString::sprintf("%d - %s", channel->Number(), channel->Name());
@@ -93,8 +93,10 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
if (!config.hideChannelLogos) {
cImage *logo = imgCache.GetLogo(channel);
if (logo) {
- pixmapLogo->DrawImage(cPoint((Width() - logoWidth) / 2, 6), *logo);
- logoFound = true;
+ const int logoheight = logo->Height();
+ const int logowidth = logo->Width();
+ pixmapLogo->DrawImage(cPoint((Width() - logowidth) / 2, (logoHeight - logoheight) / 2), *logo);
+ logoFound = true;
}
}
bool drawText = false;
diff --git a/imagecache.c b/imagecache.c
index 9b5473c..8d3e182 100644
--- a/imagecache.c
+++ b/imagecache.c
@@ -357,7 +357,7 @@ cImage *cImageCache::GetLogo(const cChannel *channel) {
delete tempStaticLogo;
tempStaticLogo = NULL;
}
- tempStaticLogo = CreateImage(geoManager.logoWidth, geoManager.logoHeight);
+ tempStaticLogo = CreateImage(geoManager.logoWidth * 0.8, geoManager.logoHeight * 0.8);
return tempStaticLogo;
} else {
//add requested logo to cache
@@ -609,7 +609,7 @@ bool cImageCache::LoadLogo(const cChannel *channel) {
}
void cImageCache::InsertIntoLogoCache(std::string channelID) {
- cImage *image = CreateImage(geoManager.logoWidth, geoManager.logoHeight);
+ cImage *image = CreateImage(geoManager.logoWidth * 0.8, geoManager.logoHeight * 0.8);
logoCache.insert(std::pair<std::string, cImage*>(channelID, image));
}
diff --git a/view.c b/view.c
index d6daf70..63b3045 100644
--- a/view.c
+++ b/view.c
@@ -108,7 +108,8 @@ void cView::DrawHeader(void) {
if (imgLoader.LoadLogo(channel, logoWidth, logoHeight)) {
cImage logo = imgLoader.GetImage();
const int logoheight = logo.Height();
- pixmapHeaderLogo->DrawImage(cPoint(border / 2, ((headerHeight - logoHeight) / 2 + (logoHeight - logoheight) / 2)), logo);
+ const int logowidth = logo.Width();
+ pixmapHeaderLogo->DrawImage(cPoint(xText + ((logoWidth - logowidth) / 2), ((headerHeight - logoheight) / 2)), logo);
xText += logoWidth + border / 2;
}
}