Skip to content

Commit

Permalink
Left justify CC-608 captions.
Browse files Browse the repository at this point in the history
With thanks to Jim Stichnoth for the patch. Refs #9030
  • Loading branch information
Mark Kendall committed Dec 12, 2010
1 parent 6bb60cd commit 3e29dab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mythtv/libs/libmythtv/subtitlescreen.cpp
Expand Up @@ -600,7 +600,7 @@ void SubtitleScreen::DisplayCC608Subtitles(void)

if (cc && (cc->text != QString::null))
{
int width = font.width(cc->text) + pad_width * 2;
int width = font.width(cc->text) + pad_width;
int x = teletextmode ? cc->y : (cc->x + 3);
int y = teletextmode ? cc->x : cc->y;
x = (int)(((float)x / (float)xscale) * (float)m_safeArea.width());
Expand All @@ -612,15 +612,16 @@ void SubtitleScreen::DisplayCC608Subtitles(void)
MythUIShape *shape = new MythUIShape(this,
QString("cc608bg%1%2%3").arg(cc->x).arg(cc->y).arg(width));
shape->SetFillBrush(bgfill);
shape->SetArea(MythRect(rect));
QRect bgrect(x - pad_width, y, width + pad_width, height);
shape->SetArea(MythRect(bgrect));
}

gTextSubFont->SetColor(clr[max(min(0, cc->color), 7)]);
MythUIText *text = new MythUIText(
cc->text, *gTextSubFont, rect, rect, (MythUIType*)this,
QString("cc608txt%1%2%3").arg(cc->x).arg(cc->y).arg(width));
if (text)
text->SetJustification(Qt::AlignCenter);
text->SetJustification(Qt::AlignLeft);
m_refreshArea = true;
VERBOSE(VB_VBI, QString("x %1 y %2 String: '%3'")
.arg(cc->x).arg(cc->y).arg(cc->text));
Expand Down

0 comments on commit 3e29dab

Please sign in to comment.