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

Francois Cartegnie git at videolan.org
Fri Aug 21 00:42:25 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Aug 19 22:50:58 2015 +0200| [0d3023803f22507d301c88242caedd8b4278a3ea] | committer: Francois Cartegnie

text_renderer: freetype: fix background alignment, try #2 (fix #9949)

or try #3 in fact :/
This reverts commit 0b6165af3b147a2cbd7bad77a983b001f2d393f8.
This reverts commit 24a593632a50984aef6296c5b124a1b74a38fd2e.

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

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

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index 9494281..10d18f7 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -732,9 +732,7 @@ static inline void RenderBackground( subpicture_region_t *p_region,
         ExtractComponents( 0x000000, &i_x, &i_y, &i_z );
 
         /* Compute the upper boundary for the background */
-        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;
+        line_top = __MAX(0, i_align_top - max_height  + p_bbox->yMax + p_line->i_base_line);
 
         /* 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