From 9c2c9534d5c48a9d462d8212f4fd96d088f0217d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Tue, 20 Aug 2024 09:30:04 +0200 Subject: [PATCH] fix: Fix horizontal alignment of WebVTT in UITextDisplayer (#7169) Fixes https://github.com/shaka-project/shaka-player/issues/7116 --- lib/text/ui_text_displayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/text/ui_text_displayer.js b/lib/text/ui_text_displayer.js index 64402ee0d2..fcbe8d7cbe 100644 --- a/lib/text/ui_text_displayer.js +++ b/lib/text/ui_text_displayer.js @@ -842,7 +842,7 @@ shaka.text.UITextDisplayer = class { if (cue.position !== null) { style.position = 'absolute'; if (cue.writingMode == Cue.writingMode.HORIZONTAL_TOP_TO_BOTTOM) { - style.right = cue.position + '%'; + style.right = (100 - cue.position) + '%'; style.width = 'auto'; } else { style.bottom = cue.position + '%';