summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2009-06-27 14:21:53 +0200
committerGrigori Goronzy <greg@blackbox>2009-06-27 14:21:53 +0200
commite7cd364193d9c724c5b269cc85ddba66f2a2a099 (patch)
tree385e9bddf6c4562284466a72c7b1ce946583e036
parentaf0db69d3f4ca6dfe579135a7d7aa4236e90f0b6 (diff)
downloadlibass-e7cd364193d9c724c5b269cc85ddba66f2a2a099.tar.bz2
libass-e7cd364193d9c724c5b269cc85ddba66f2a2a099.tar.xz
Fix rotation and subpixel placement
Add subpixel shift to the points after rotation transformations to fix rotations and subpixel accuracy.
-rw-r--r--libass/ass_render.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 0570fd6..9e1c008 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;
}
}