Skip to content

Commit efcfee3

Browse files
committed
Subtitles: Fix layout to stay within the safe area.
Subtitle backgrounds were sometimes extending to the left of the safe area, which is not what was intended. Shift subtitles by that amount to compensate.
1 parent f8cb0f7 commit efcfee3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mythtv/libs/libmythtv/subtitlescreen.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,11 +1232,13 @@ bool FormattedTextSubtitle::Draw(QList<MythUIType*> *imageCache,
12321232
QSize chunk_sz = (*chunk).CalcSize();
12331233
if ((*chunk).format.GetBGAlpha())
12341234
{
1235+
int padding = font.maxWidth() * PAD_WIDTH;
1236+
if (first)
1237+
x += padding;
12351238
QBrush bgfill = QBrush((*chunk).format.GetBGColor());
12361239
QRect bgrect(x, y, chunk_sz.width(), height);
12371240
if (first)
1238-
bgrect.setLeft(bgrect.left() + x_adjust -
1239-
font.maxWidth() * PAD_WIDTH);
1241+
bgrect.setLeft(bgrect.left() + x_adjust - padding);
12401242
MythUIShape *bgshape = new MythUIShape(parent,
12411243
QString("subbg%1x%2@%3,%4")
12421244
.arg(chunk_sz.width())

0 commit comments

Comments
 (0)