[vlc-commits] text_renderer: freetype: fix background alignment (fix #9949)

Francois Cartegnie git at videolan.org
Tue Aug 11 02:35:41 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Aug 11 01:00:23 2015 +0200| [0b6165af3b147a2cbd7bad77a983b001f2d393f8] | committer: Francois Cartegnie

text_renderer: freetype: fix background alignment (fix #9949)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0b6165af3b147a2cbd7bad77a983b001f2d393f8
---

 modules/text_renderer/freetype.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index 40c470c..987d05d 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -729,10 +729,9 @@ static inline void RenderBackground( subpicture_region_t *p_region,
         ExtractComponents( 0x000000, &i_x, &i_y, &i_z );
 
         /* Compute the upper boundary for the background */
-        if ((i_align_top + p_line->i_base_line - max_height) < 0 || p_line->i_base_line <= p_line->i_height)
-            line_top = i_align_top + p_line->i_base_line;
-        else
-            line_top = i_align_top + p_line->i_base_line - max_height;
+        line_top = i_align_top + p_line->i_base_line;
+        if( p_line->i_height && p_line->i_height < max_height )
+            line_top += max_height - p_line->i_height;
 
         /* Compute lower boundary for the background */
         line_bottom =  __MIN(line_top + p_line->i_height, p_region->fmt.i_visible_height);



More information about the vlc-commits mailing list