Fix left position for subtitles.

When SubtitlePainter positions the cues centred in the given box, it must add
the left offset of the box to get the correct position.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215535289
This commit is contained in:
tonihei 2018-10-03 02:33:53 -07:00 committed by Oliver Woodman
parent 43c01562d1
commit f0e0a7cf57

View file

@ -310,7 +310,7 @@ import com.google.android.exoplayer2.util.Util;
textLeft = Math.max(textLeft, parentLeft);
textRight = Math.min(textLeft + textWidth, parentRight);
} else {
textLeft = (parentWidth - textWidth) / 2;
textLeft = (parentWidth - textWidth) / 2 + parentLeft;
textRight = textLeft + textWidth;
}