[vlc-commits] text_renderer: freetype: fix background on visible chars limit
Francois Cartegnie
git at videolan.org
Tue Nov 14 18:54:08 CET 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Nov 13 17:54:01 2017 +0100| [c726087e6a47c11811d5e1fc3dc0971e182275ed] | committer: Francois Cartegnie
text_renderer: freetype: fix background on visible chars limit
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c726087e6a47c11811d5e1fc3dc0971e182275ed
---
modules/text_renderer/freetype/freetype.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
index 33f661fa1f..2385b4a9a4 100644
--- a/modules/text_renderer/freetype/freetype.c
+++ b/modules/text_renderer/freetype/freetype.c
@@ -753,7 +753,7 @@ static inline void RenderBackground( subpicture_region_t *p_region,
}
/* Compute the background for the line (identify leading/trailing space) */
- int line_start = offset.x + p_line->p_character[p_line->i_first_visible_char_index].p_glyph->left - p_regionbbox->xMin;
+ int line_start = offset.x + p_line->p_character[p_line->i_first_visible_char_index].bbox.xMin - p_regionbbox->xMin;
/* Fudge factor to make sure caption background edges are left aligned
despite variable font width */
@@ -775,9 +775,7 @@ static inline void RenderBackground( subpicture_region_t *p_region,
}
/* Find right boundary for bounding box for background */
- int line_end = offset.x +
- p_line->p_character[i_seg_end].p_glyph->left - p_regionbbox->xMin +
- p_line->p_character[i_seg_end].p_glyph->bitmap.width;
+ int line_end = offset.x + p_line->p_character[i_seg_end].bbox.xMax - p_regionbbox->xMin;
const line_character_t *p_char = &p_line->p_character[i_char_index];
if( p_char->p_style->i_style_flags & STYLE_BACKGROUND )
More information about the vlc-commits
mailing list