summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2014-04-25 16:56:59 +0200
committerlouis <louis.braun@gmx.de>2014-04-25 16:56:59 +0200
commiteccef0c7d0c6fc92b0d94abc7ab348f1439cfeef (patch)
tree356fd1853b6fe9fa24dfd25c286227208e3e7267
parent6418f85f5f3d5ec62b1f62b9283ae8667836e7b6 (diff)
downloadskin-nopacity-eccef0c7d0c6fc92b0d94abc7ab348f1439cfeef.tar.gz
skin-nopacity-eccef0c7d0c6fc92b0d94abc7ab348f1439cfeef.tar.bz2
fixed img positioning
-rw-r--r--detailview.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/detailview.c b/detailview.c
index 0ed1861..f5d62c3 100644
--- a/detailview.c
+++ b/detailview.c
@@ -166,15 +166,19 @@ void cNopacityView::DrawFloatingContent(std::string *infoText, cTvMedia *img, cT
cTextWrapper wTextFull;
int imgWidth = img->width;
int imgHeight = img->height;
+ int imgWidth2 = 0;
+ int imgHeight2 = 0;
if (imgHeight > (contentHeight - 2 * border)) {
imgHeight = contentHeight - 2 * border;
imgWidth = imgWidth * ((double)imgHeight / (double)img->height);
}
+ int imgHeightTotal = imgHeight;
if (img2) {
- imgWidth = max(img->width, img2->width);
- imgHeight += img2->height + border;
+ imgWidth2 = imgWidth;
+ imgHeight2 = img2->height * ((double)img2->width / (double)imgWidth2);
+ imgHeightTotal += img2->height + border;
}
- CreateFloatingTextWrapper(&wTextTall, &wTextFull, infoText, imgWidth, imgHeight);
+ CreateFloatingTextWrapper(&wTextTall, &wTextFull, infoText, imgWidth, imgHeightTotal);
int lineHeight = font->Height();
int textLinesTall = wTextTall.Lines();
int textLinesFull = wTextFull.Lines();
@@ -198,9 +202,9 @@ void cNopacityView::DrawFloatingContent(std::string *infoText, cTvMedia *img, cT
if (!img2)
return;
osd->Flush();
- if (imgLoader.LoadPoster(img2->path.c_str(), img2->width, img2->height)) {
+ if (imgLoader.LoadPoster(img2->path.c_str(), imgWidth2, imgHeight2)) {
if (Running() && pixmapContent)
- pixmapContent->DrawImage(cPoint(width - img2->width - border, imgHeight + 2*border), imgLoader.GetImage());
+ pixmapContent->DrawImage(cPoint(width - imgWidth2 - border, imgHeight + 2*border), imgLoader.GetImage());
}
}