From f0e0a7cf57323b41f44de611e2e52f865f760f01 Mon Sep 17 00:00:00 2001 From: tonihei Date: Wed, 3 Oct 2018 02:33:53 -0700 Subject: [PATCH] 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 --- .../java/com/google/android/exoplayer2/ui/SubtitlePainter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitlePainter.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitlePainter.java index d8c61f5e05..4f22362de6 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitlePainter.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitlePainter.java @@ -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; }