[vlc-commits] text_renderer: freetype: fix next line alignment on line break
Francois Cartegnie
git at videolan.org
Mon Jun 26 12:40:47 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Jun 26 12:37:24 2017 +0200| [619b2b6d14be8c5db7a7911486d271450c9f14bf] | committer: Francois Cartegnie
text_renderer: freetype: fix next line alignment on line break
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=619b2b6d14be8c5db7a7911486d271450c9f14bf
---
modules/text_renderer/freetype/text_layout.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/modules/text_renderer/freetype/text_layout.c b/modules/text_renderer/freetype/text_layout.c
index c29846f51e..bbd88f5dfc 100644
--- a/modules/text_renderer/freetype/text_layout.c
+++ b/modules/text_renderer/freetype/text_layout.c
@@ -1453,11 +1453,19 @@ static int LayoutParagraph( filter_t *p_filter, paragraph_t *p_paragraph,
/* If we created a line up to previous space, we only keep the difference for
our current width since that split */
if( i_newline_start == i_last_space )
+ {
i_width = i_width - i_last_space_width;
+ if( i_newline_start + 1 < p_paragraph->i_size )
+ i_line_start = i_newline_start + 1;
+ else
+ i_line_start = i_newline_start; // == i
+ }
else
+ {
i_width = 0;
+ i_line_start = i_newline_start;
+ }
i_last_space_width = 0;
- i_line_start = i_newline_start;
}
i_width += i_advance_x;
}
More information about the vlc-commits
mailing list