summaryrefslogtreecommitdiff
path: root/displaychannel.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-05-04 17:18:05 +0200
committerlouis <louis.braun@gmx.de>2013-05-04 17:18:05 +0200
commit993bdf2ed543d832eebb1de158134223254dc8ee (patch)
tree81b8b7b98ff5ee3b4e31560cd768ed118e2d8af3 /displaychannel.c
parent1bfdd7c81c641cc0e782b7bf360497b060a1d39b (diff)
downloadskin-nopacity-993bdf2ed543d832eebb1de158134223254dc8ee.tar.gz
skin-nopacity-993bdf2ed543d832eebb1de158134223254dc8ee.tar.bz2
Implemented workaround for VDR DrawEllipse bug
Diffstat (limited to 'displaychannel.c')
-rw-r--r--displaychannel.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/displaychannel.c b/displaychannel.c
index bdd23c8..de8ff1d 100644
--- a/displaychannel.c
+++ b/displaychannel.c
@@ -202,24 +202,28 @@ void cNopacityDisplayChannel::DrawBackground(void){
pixmapLogoBackground->Fill(clrTransparent);
pixmapLogoBackgroundBottom->Fill(clrTransparent);
}
-
- if ((config.backgroundStyle == bsTrans) || ((config.logoPosition == lpNone))) {
- pixmapBackgroundTop->DrawEllipse(cRect(0, 0, channelInfoHeight/2, channelInfoHeight/2), clrTransparent, -2);
- pixmapBackgroundTop->DrawEllipse(cRect(infoWidth - channelInfoHeight/2, 0, channelInfoHeight/2, channelInfoHeight/2), clrTransparent, -1);
- pixmapBackgroundBottom->DrawEllipse(cRect(0, streamInfoHeight/2, streamInfoHeight/2, streamInfoHeight/2), clrTransparent, -3);
- pixmapBackgroundBottom->DrawEllipse(cRect(infoWidth - streamInfoHeight/2, streamInfoHeight/2, streamInfoHeight/2, streamInfoHeight/2), clrTransparent, -4);
- } else if ((config.backgroundStyle == bsFull) && (config.logoPosition == lpLeft)){
- pixmapLogoBackgroundTop->DrawEllipse(cRect(0, 0, channelInfoHeight/2, channelInfoHeight/2), clrTransparent, -2);
- pixmapBackgroundTop->DrawEllipse(cRect(infoWidth - channelInfoHeight/2, 0, channelInfoHeight/2, channelInfoHeight/2), clrTransparent, -1);
- pixmapLogoBackgroundBottom->DrawEllipse(cRect(0, streamInfoHeight/2, streamInfoHeight/2, streamInfoHeight/2), clrTransparent, -3);
- pixmapBackgroundBottom->DrawEllipse(cRect(infoWidth - streamInfoHeight/2, streamInfoHeight/2, streamInfoHeight/2, streamInfoHeight/2), clrTransparent, -4);
- } else if ((config.backgroundStyle == bsFull) && (config.logoPosition == lpRight)){
- pixmapBackgroundTop->DrawEllipse(cRect(0, 0, channelInfoHeight/2, channelInfoHeight/2), clrTransparent, -2);
- pixmapLogoBackgroundTop->DrawEllipse(cRect(pixmapLogoBackgroundTop->ViewPort().Width() - channelInfoHeight/2, 0, channelInfoHeight/2, channelInfoHeight/2), clrTransparent, -1);
- pixmapBackgroundBottom->DrawEllipse(cRect(0, streamInfoHeight/2, streamInfoHeight/2, streamInfoHeight/2), clrTransparent, -3);
- pixmapLogoBackgroundBottom->DrawEllipse(cRect(pixmapLogoBackgroundBottom->ViewPort().Width() - streamInfoHeight/2, streamInfoHeight/2, streamInfoHeight/2, streamInfoHeight/2), clrTransparent, -4);
+
+ int cornerTopSize = channelInfoHeight/2;
+ int cornerBottomSize = streamInfoHeight/2;
+ if ((cornerTopSize > 2)&&(cornerBottomSize > 2)) {
+ if ((config.backgroundStyle == bsTrans) || ((config.logoPosition == lpNone))) {
+ pixmapBackgroundTop->DrawEllipse(cRect(0, 0, cornerTopSize, cornerTopSize), clrTransparent, -2);
+ pixmapBackgroundTop->DrawEllipse(cRect(infoWidth - cornerTopSize, 0, cornerTopSize, cornerTopSize), clrTransparent, -1);
+ pixmapBackgroundBottom->DrawEllipse(cRect(0, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -3);
+ pixmapBackgroundBottom->DrawEllipse(cRect(infoWidth - cornerBottomSize, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -4);
+ } else if ((config.backgroundStyle == bsFull) && (config.logoPosition == lpLeft)){
+ pixmapLogoBackgroundTop->DrawEllipse(cRect(0, 0, cornerTopSize, cornerTopSize), clrTransparent, -2);
+ pixmapBackgroundTop->DrawEllipse(cRect(infoWidth - cornerTopSize, 0, cornerTopSize, cornerTopSize), clrTransparent, -1);
+ pixmapLogoBackgroundBottom->DrawEllipse(cRect(0, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -3);
+ pixmapBackgroundBottom->DrawEllipse(cRect(infoWidth - cornerBottomSize, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -4);
+ } else if ((config.backgroundStyle == bsFull) && (config.logoPosition == lpRight)){
+ pixmapBackgroundTop->DrawEllipse(cRect(0, 0, cornerTopSize, cornerTopSize), clrTransparent, -2);
+ pixmapLogoBackgroundTop->DrawEllipse(cRect(pixmapLogoBackgroundTop->ViewPort().Width() - cornerTopSize, 0, cornerTopSize, cornerTopSize), clrTransparent, -1);
+ pixmapBackgroundBottom->DrawEllipse(cRect(0, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -3);
+ pixmapLogoBackgroundBottom->DrawEllipse(cRect(pixmapLogoBackgroundBottom->ViewPort().Width() - cornerBottomSize, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -4);
+ }
}
-
+
pixmapChannelInfo->Fill(clrTransparent);
pixmapDate->Fill(clrTransparent);
pixmapLogo->Fill(clrTransparent);
@@ -588,6 +592,8 @@ void cNopacityDisplayChannel::DrawProgressBar(int Current, int Total) {
int barHeight = pixmapProgressBar->ViewPort().Height()-8;
if (barHeight%2 != 0)
barHeight++;
+ if (barHeight < 3)
+ return;
int barFullWidth = pixmapProgressBar->ViewPort().Width() - 20 - barHeight;
double percentSeen = ((double)Current) / (double)Total;