summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Grimm <git@e-tobi.net>2011-08-21 14:18:15 +0200
committerTobias Grimm <git@e-tobi.net>2011-08-21 14:38:02 +0200
commit04616e5fb5944c83d559217d897e5fef8d75e614 (patch)
tree7c8be7b7d642a9fbdb96e0e09f8970d4e21bd876
parent8d6de4e25d286eefe247cf15bc204a5cc2b228cb (diff)
downloadvdr-plugin-ttxtsubs-04616e5fb5944c83d559217d897e5fef8d75e614.tar.gz
vdr-plugin-ttxtsubs-04616e5fb5944c83d559217d897e5fef8d75e614.tar.bz2
Show subtitles with backround rectangle, if outline width is < 2
(patch provided by Mike Lampard) (Closes #247)
-rw-r--r--HISTORY2
-rw-r--r--ttxtsubsdisplay.c11
2 files changed, 13 insertions, 0 deletions
diff --git a/HISTORY b/HISTORY
index 5f391bb..33105ea 100644
--- a/HISTORY
+++ b/HISTORY
@@ -7,6 +7,8 @@ VDR Plugin 'ttxtsubs' Revision History
- Converted *.po to UTF-8
- Updated patch for VDR 1.7.20 (Closes #689)
- Don't log all page info received from VDR (Closes #331)
+- Show subtitles with backround rectangle, if outline width is < 2
+ (patch provided by Mike Lampard) (Closes #247)
2010-05-08: Version 0.2.2
- Fixed channel retune triggering in VDR patch and updated patch to 1.7.14
diff --git a/ttxtsubsdisplay.c b/ttxtsubsdisplay.c
index 7669823..9453a2f 100644
--- a/ttxtsubsdisplay.c
+++ b/ttxtsubsdisplay.c
@@ -423,6 +423,17 @@ void cTtxtSubsDisplay::ShowOSD(void)
_osd->DrawRectangle(0, 0, width - 1, height - 1, clrTransparent);
+ if(globals.mOutlineWidth < 2){
+ int maxwidth = 0;
+ for (int line = 0; line < _numberOfSubTitleTextLines; line++) {
+ int linewidth = _osdFont->Width(_subTitleTextLines[line].text);
+ if(linewidth > maxwidth)
+ maxwidth = linewidth;
+ }
+ maxwidth+=40;
+ _osd->DrawRectangle((width/2)-(maxwidth/2), 0, (width/2)+(maxwidth/2), height - 1, 0x8a000000);
+ }
+
for(int textLineIndex = 0; textLineIndex < _numberOfSubTitleTextLines; textLineIndex++)
{
int lineWidth = _osdFont->Width(_subTitleTextLines[textLineIndex].text) + 2 * globals.mOutlineWidth + 5;