From 2e65ef93b51ce2577d19b93009c04fbc80df1ed3 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Fri, 8 Jul 2011 19:05:14 +0200 Subject: Fix coordinates after repositioning --- libass/ass_render.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index 7e37b41..ec1f839 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1893,14 +1893,23 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event, ass_shaper_reorder(text_info, ctypes, emblevels, cmap); // Reposition according to the map - // FIXME: y coordinate for shearing, etc. pen.x = 0; + pen.y = 0; + int lineno = 1; for (i = 0; i < text_info->length; i++) { GlyphInfo *info = glyphs + cmap[i]; - if (glyphs[i].linebreak) + if (glyphs[i].linebreak) { pen.x = 0; + pen.y += double_to_d6(text_info->lines[lineno-1].desc); + pen.y += double_to_d6(text_info->lines[lineno].asc); + pen.y += double_to_d6(render_priv->settings.line_spacing); + lineno++; + } + if (info->skip) continue; info->pos.x = pen.x; + info->pos.y = pen.y; pen.x += info->advance.x; + pen.y += info->advance.y; } // align text -- cgit v1.2.3