summaryrefslogtreecommitdiffstats
path: root/libass/ass_render.c
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2009-06-28 02:36:31 +0200
committerGrigori Goronzy <greg@blackbox>2009-06-28 02:36:31 +0200
commita75f6a8d3d3ed6410cc2a4efa866a99152d78af6 (patch)
treed5f0ae407aed864c64f9dc2cda6762cc9170f230 /libass/ass_render.c
parent07bcf7f7cee44d208e07ae13d890d61a94c2d260 (diff)
downloadlibass-a75f6a8d3d3ed6410cc2a4efa866a99152d78af6.tar.bz2
libass-a75f6a8d3d3ed6410cc2a4efa866a99152d78af6.tar.xz
Fix subpixel shift calculation for negative coordinates
The subpixel shift calculation was off in case the device coordinates were negative. This has been corrected and the calculation been simplified.
Diffstat (limited to 'libass/ass_render.c')
-rw-r--r--libass/ass_render.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index a9de0af..2abb9d7 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -2654,11 +2654,11 @@ ass_render_event(ass_renderer_t *render_priv, ass_event_t *event,
for (i = 0; i < text_info->length; ++i) {
glyph_info_t *g = text_info->glyphs + i;
g->hash_key.advance.x =
- (double_to_d6(device_x) & SUBPIXEL_MASK) +
- (g->pos.x & SUBPIXEL_MASK);
+ double_to_d6(device_x - (int) device_x +
+ d6_to_double(g->pos.x & SUBPIXEL_MASK));
g->hash_key.advance.y =
- (double_to_d6(device_y) & SUBPIXEL_MASK) +
- (g->pos.y & SUBPIXEL_MASK);
+ double_to_d6(device_y - (int) device_y +
+ d6_to_double(g->pos.y & SUBPIXEL_MASK));
get_bitmap_glyph(render_priv, text_info->glyphs + i);
}