[vlc-commits] [Git][videolan/vlc][master] codec: webvtt: fix line: 0% alignment
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sun Nov 9 05:10:24 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
0f215cb3 by Steve Lhomme at 2025-11-09T04:54:39+00:00
codec: webvtt: fix line: 0% alignment
A line: 0% positioning should set the box on top of the video viewport [^1]
(when alignment is top-left which is the default).
Fixes #29230
[^1]: https://www.w3.org/TR/webvtt1/#webvtt-line-cue-setting
- - - - -
1 changed file:
- modules/codec/webvtt/subsvtt.c
Changes:
=====================================
modules/codec/webvtt/subsvtt.c
=====================================
@@ -258,7 +258,7 @@ static void webvtt_get_cueboxrect( const webvtt_cue_settings_t *p_settings,
/* we need 100% or size for inner_align to work on writing direction */
if( p_settings->vertical == WEBVTT_ALIGN_AUTO ) /* Horizontal text */
{
- p_rect->y = line_offset > 0 ? line_offset : 1.0 + line_offset;
+ p_rect->y = line_offset >= 0 ? line_offset : 1.0 + line_offset;
p_rect->w = (extent) ? extent : 1.0;
if( indent_anchor_position > 0 &&
(alignment_on_indent_anchor == WEBVTT_ALIGN_LEFT ||
@@ -271,9 +271,9 @@ static void webvtt_get_cueboxrect( const webvtt_cue_settings_t *p_settings,
else /* Vertical text */
{
if( p_settings->vertical == WEBVTT_ALIGN_LEFT )
- p_rect->x = line_offset > 0 ? 1.0 - line_offset : -line_offset;
+ p_rect->x = line_offset >= 0 ? 1.0 - line_offset : -line_offset;
else
- p_rect->x = line_offset > 0 ? line_offset : 1.0 + line_offset;
+ p_rect->x = line_offset >= 0 ? line_offset : 1.0 + line_offset;
p_rect->y = (extent) ? extent : 1.0;
if( indent_anchor_position > 0 &&
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0f215cb3cc6b3e4f94571c54a5e69c2d17dacb58
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0f215cb3cc6b3e4f94571c54a5e69c2d17dacb58
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list