[vlc-commits] text_renderer: freetype: fix growing background
Francois Cartegnie
git at videolan.org
Wed Jan 15 18:10:24 CET 2020
vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan 15 18:07:06 2020 +0100| [003979fce541c6d208cbc10a19d854cea4d4ab9d] | committer: Francois Cartegnie
text_renderer: freetype: fix growing background
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=003979fce541c6d208cbc10a19d854cea4d4ab9d
---
modules/text_renderer/freetype/freetype.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
index b92c66ceac..a22d33c8bd 100644
--- a/modules/text_renderer/freetype/freetype.c
+++ b/modules/text_renderer/freetype/freetype.c
@@ -1160,6 +1160,11 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
else if( p_region_in->i_y > 0 && (unsigned)p_region_in->i_y < i_max_height )
i_max_height -= p_region_in->i_y;
+ rv = LayoutText( p_filter,
+ psz_text, pp_styles, pi_k_durations, i_text_length,
+ p_region_in->b_gridmode, p_region_in->b_balanced_text,
+ i_max_width, i_max_height, &p_lines, &bbox, &i_max_face_height );
+
uint8_t i_background_opacity = var_InheritInteger( p_filter, "freetype-background-opacity" );
i_background_opacity = VLC_CLIP( i_background_opacity, 0, 255 );
int i_margin = (i_background_opacity > 0 && !p_region_in->b_gridmode) ? i_max_face_height / 4 : 0;
@@ -1167,11 +1172,6 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
if( (unsigned)i_margin * 2 >= i_max_width || (unsigned)i_margin * 2 >= i_max_height )
i_margin = 0;
- rv = LayoutText( p_filter,
- psz_text, pp_styles, pi_k_durations, i_text_length,
- p_region_in->b_gridmode, p_region_in->b_balanced_text,
- i_max_width, i_max_height, &p_lines, &bbox, &i_max_face_height );
-
/* Don't attempt to render text that couldn't be layed out
* properly. */
if( !rv && i_text_length > 0 && bbox.xMin < bbox.xMax && bbox.yMin < bbox.yMax )
More information about the vlc-commits
mailing list