diff options
author | Oleg Oshmyan <chortos@inbox.lv> | 2020-10-19 16:25:58 +0300 |
---|---|---|
committer | Oleg Oshmyan <chortos@inbox.lv> | 2020-10-27 01:24:26 +0200 |
commit | 512444c15e69a78ae82a8e9ff0e7bdef9f93bbcf (patch) | |
tree | 39950ed1dbc6fbf50edbdb1ce912f9debf4e659d /libass/ass_parse.c | |
parent | 7440eb75f12104b1cdd36638ccb16934db067b0c (diff) | |
download | libass-512444c15e69a78ae82a8e9ff0e7bdef9f93bbcf.tar.bz2 libass-512444c15e69a78ae82a8e9ff0e7bdef9f93bbcf.tar.xz |
Improve \kf position rounding
Diffstat (limited to 'libass/ass_parse.c')
-rw-r--r-- | libass/ass_parse.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libass/ass_parse.c b/libass/ass_parse.c index ef4b0e0..9107545 100644 --- a/libass/ass_parse.c +++ b/libass/ass_parse.c @@ -1006,12 +1006,12 @@ void process_karaoke_effects(ASS_Renderer *render_priv) int x; if (tm_current < tm_start) - x = -1000000; + x = -100000000; else if (tm_current >= tm_end) - x = 1000000; + x = 100000000; else { - int x_start = d6_to_int(start->pos.x); - int x_end = d6_to_int(end[-1].pos.x + end[-1].advance.x); + int x_start = start->pos.x; + int x_end = end[-1].pos.x + end[-1].advance.x; double dt = (double) (tm_current - tm_start) / (tm_end - tm_start); double frz = fmod(start->frz, 360); if (frz > 90 && frz < 270) { @@ -1023,12 +1023,12 @@ void process_karaoke_effects(ASS_Renderer *render_priv) info->c[1] = tmp; } } - x = x_start + (x_end - x_start) * dt; + x = x_start + lrint((x_end - x_start) * dt); } for (GlyphInfo *info = start; info < end; info++) { info->effect_type = effect_type; - info->effect_timing = x - d6_to_int(info->pos.x); + info->effect_timing = x - info->pos.x; } } } |