From e7cd364193d9c724c5b269cc85ddba66f2a2a099 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Sat, 27 Jun 2009 14:21:53 +0200 Subject: Fix rotation and subpixel placement Add subpixel shift to the points after rotation transformations to fix rotations and subpixel accuracy. --- libass/ass_render.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libass/ass_render.c') diff --git a/libass/ass_render.c b/libass/ass_render.c index 0570fd6f..9e1c0082 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -2127,8 +2127,8 @@ transform_3d_points(FT_Vector shift, FT_Glyph glyph, double frx, int i; for (i = 0; i < outline->n_points; i++) { - x = (double) p[i].x + shift.x + (-fax * p[i].y) + subshift.x; - y = (double) p[i].y + shift.y + (-fay * p[i].x) - subshift.y; + x = (double) p[i].x + shift.x + (-fax * p[i].y); + y = (double) p[i].y + shift.y + (-fay * p[i].x); z = 0.; xx = x * cz + y * sz; @@ -2149,6 +2149,8 @@ transform_3d_points(FT_Vector shift, FT_Glyph glyph, double frx, y = (yy * 20000) / (zz + 20000); p[i].x = x - shift.x + 0.5; p[i].y = y - shift.y + 0.5; + p[i].x += subshift.x; + p[i].y -= subshift.y; } } -- cgit v1.2.3