diff options
author | Oleg Oshmyan <chortos@inbox.lv> | 2020-10-16 16:29:18 +0300 |
---|---|---|
committer | Oleg Oshmyan <chortos@inbox.lv> | 2020-10-27 01:24:12 +0200 |
commit | cf73dd7cf0c58dfce800906ae74489d307860cdb (patch) | |
tree | bc1cc6c79baade3a0df86869e05c341116f4e8f6 /libass | |
parent | 595ab0f2930371826acdf604313302ee97e4a233 (diff) | |
download | libass-cf73dd7cf0c58dfce800906ae74489d307860cdb.tar.bz2 libass-cf73dd7cf0c58dfce800906ae74489d307860cdb.tar.xz |
process_karaoke_effects: compute \kf from glyph advances, not bounds
Both ways make sense, but traditional VSFilter does it this way.
Diffstat (limited to 'libass')
-rw-r--r-- | libass/ass_parse.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libass/ass_parse.c b/libass/ass_parse.c index c0e2660..e500046 100644 --- a/libass/ass_parse.c +++ b/libass/ass_parse.c @@ -1006,12 +1006,8 @@ void process_karaoke_effects(ASS_Renderer *render_priv) else if (tm_current >= tm_end) x = 1000000; else { - int x_start = 1000000; - int x_end = -1000000; - for (GlyphInfo *info = start; info < end; info++) { - x_start = FFMIN(x_start, d6_to_int(info->bbox.x_min + info->pos.x)); - x_end = FFMAX(x_end, d6_to_int(info->bbox.x_max + info->pos.x)); - } + int x_start = d6_to_int(start->pos.x); + int x_end = d6_to_int(end[-1].pos.x + end[-1].advance.x); double dt = (double) (tm_current - tm_start) / (tm_end - tm_start); x = x_start + (x_end - x_start) * dt; } |