]> granicus.if.org Git - libass/commitdiff
Use cluster advance in compute_string_bbox to account for \fsp
authorOleg Oshmyan <chortos@inbox.lv>
Sun, 9 Feb 2014 03:18:39 +0000 (03:18 +0000)
committerOleg Oshmyan <chortos@inbox.lv>
Tue, 11 Feb 2014 16:39:11 +0000 (16:39 +0000)
Fixes libass#16 (the remaining sub-issue).

libass/ass_render.c

index 58d1a157110fe86666c7ed7423da4adaede75cb1..5f03ab5ba8cae0615a22484bb2df3ea2ffaf40c7 100644 (file)
@@ -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.;