diff options
author | Oleg Oshmyan <chortos@inbox.lv> | 2014-02-09 03:18:39 +0000 |
---|---|---|
committer | Oleg Oshmyan <chortos@inbox.lv> | 2014-02-11 16:39:11 +0000 |
commit | d72fdb66f426cd7fbd05ab93d1470dabe92a4bd4 (patch) | |
tree | 539bc7c00335fe4805772586520530fa7aa5cf65 | |
parent | da4af2b6d86491536b0999f5b731c30b13ff0ac9 (diff) | |
download | libass-d72fdb66f426cd7fbd05ab93d1470dabe92a4bd4.tar.bz2 libass-d72fdb66f426cd7fbd05ab93d1470dabe92a4bd4.tar.xz |
Use cluster advance in compute_string_bbox to account for \fsp
Fixes libass#16 (the remaining sub-issue).
-rw-r--r-- | libass/ass_render.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c index 58d1a15..5f03ab5 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -735,13 +735,10 @@ static void compute_string_bbox(TextInfo *text, DBBox *bbox) for (i = 0; i < text->length; ++i) { GlyphInfo *info = text->glyphs + i; if (info->skip) continue; - while (info) { - double s = d6_to_double(info->pos.x); - double e = s + d6_to_double(info->advance.x); - bbox->xMin = FFMIN(bbox->xMin, s); - bbox->xMax = FFMAX(bbox->xMax, e); - info = info->next; - } + double s = d6_to_double(info->pos.x); + double e = s + d6_to_double(info->cluster_advance.x); + bbox->xMin = FFMIN(bbox->xMin, s); + bbox->xMax = FFMAX(bbox->xMax, e); } } else bbox->xMin = bbox->xMax = bbox->yMin = bbox->yMax = 0.; |