summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2020-10-29 02:55:31 +0200
committerOleg Oshmyan <chortos@inbox.lv>2020-10-29 04:38:34 +0200
commit41f044de3b34d0b406f155559cd71b827f5a27ac (patch)
tree4d8e2399d014bbe52ff069cf8edb1e6dc6df927c
parent59eb317aaa495ad5331c9efdf8d7bf3d860c2992 (diff)
downloadlibass-41f044de3b34d0b406f155559cd71b827f5a27ac.tar.bz2
libass-41f044de3b34d0b406f155559cd71b827f5a27ac.tar.xz
shape_harfbuzz_process_run: round scaled positions properly
-rw-r--r--libass/ass_shaper.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libass/ass_shaper.c b/libass/ass_shaper.c
index 3718e45..41392c6 100644
--- a/libass/ass_shaper.c
+++ b/libass/ass_shaper.c
@@ -638,10 +638,10 @@ shape_harfbuzz_process_run(GlyphInfo *glyphs, hb_buffer_t *buf, int offset)
// set position and advance
info->skip = false;
info->glyph_index = glyph_info[j].codepoint;
- info->offset.x = pos[j].x_offset * info->scale_x;
- info->offset.y = -pos[j].y_offset * info->scale_y;
- info->advance.x = pos[j].x_advance * info->scale_x;
- info->advance.y = -pos[j].y_advance * info->scale_y;
+ info->offset.x = lrint(pos[j].x_offset * info->scale_x);
+ info->offset.y = lrint(-pos[j].y_offset * info->scale_y);
+ info->advance.x = lrint(pos[j].x_advance * info->scale_x);
+ info->advance.y = lrint(-pos[j].y_advance * info->scale_y);
// accumulate advance in the root glyph
root->cluster_advance.x += info->advance.x;