[vlc-commits] text_renderer: freetype: set max width according to offset
Francois Cartegnie
git at videolan.org
Tue Jun 6 20:28:54 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jun 6 16:21:14 2017 +0200| [307e8bf78804c78295e6eafaaab9bdb074d05d75] | committer: Francois Cartegnie
text_renderer: freetype: set max width according to offset
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=307e8bf78804c78295e6eafaaab9bdb074d05d75
---
modules/text_renderer/freetype/freetype.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
index ae3a652d3e..aa98ab6d2d 100644
--- a/modules/text_renderer/freetype/freetype.c
+++ b/modules/text_renderer/freetype/freetype.c
@@ -1133,6 +1133,10 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
uint32_t *pi_k_durations = NULL;
+ unsigned i_max_width = p_filter->fmt_out.video.i_visible_width;
+ if( p_region_in->i_x > 0 && (unsigned)p_region_in->i_x < i_max_width )
+ i_max_width -= p_region_in->i_x;
+
rv = LayoutText( p_filter,
psz_text, pp_styles, pi_k_durations, i_text_length, p_region_in->b_gridmode,
p_filter->fmt_out.video.i_visible_width,
More information about the vlc-commits
mailing list