summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2011-07-08 19:05:14 +0200
committerGrigori Goronzy <greg@blackbox>2011-07-08 19:06:05 +0200
commit2e65ef93b51ce2577d19b93009c04fbc80df1ed3 (patch)
treeb5711baf86161ecc542210e9294bbfbc2a6c5f88
parent811a06975a0088cf447ab21a1690df65ae76dca4 (diff)
downloadlibass-2e65ef93b51ce2577d19b93009c04fbc80df1ed3.tar.bz2
libass-2e65ef93b51ce2577d19b93009c04fbc80df1ed3.tar.xz
Fix coordinates after repositioning
-rw-r--r--libass/ass_render.c13
1 files 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