summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce Harrington <bryce@osg.samsung.com>2014-12-04 14:36:49 -0800
committerBryce Harrington <bryce@osg.samsung.com>2014-12-04 16:19:55 -0800
commit3fbe0cbb8799a3238af39ec021475d427009f419 (patch)
tree850e512254a3e87f8f9c80c2cf7a7099d1e64c45
parent9adb3d325f8663cabccc2a36498d42bd3ab88438 (diff)
Fix broken rotationsperspective-transform
Patch thanks to Derek Foreman <derekf@osg.samsung.com>
-rw-r--r--src/cairo-matrix.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cairo-matrix.c b/src/cairo-matrix.c
index 6d6e3446e..83c6ebad1 100644
--- a/src/cairo-matrix.c
+++ b/src/cairo-matrix.c
@@ -356,8 +356,6 @@ cairo_matrix_multiply (cairo_matrix_t *result, const cairo_matrix_t *a, const ca
r.py = a->xy * b->px + a->yy * b->py + a->py * 1;
p0 = a->x0 * b->px + a->y0 * b->py + 1 * 1;
- printf("cairo_matrix_multiply: xx=%f yx=%f xy=%f yy=%f x0=%f y0=%f\n", r.xx, r.yx, r.xy, r.yy, r.x0, r.y0);
-
_cairo_matrix_scalar_multiply (&r, 1 / p0);
*result = r;
@@ -414,10 +412,11 @@ void
cairo_matrix_transform_distance (const cairo_matrix_t *matrix, double *dx, double *dy)
{
double new_p;
+ double old_x = *dx;
new_p = matrix->px * *dx + matrix->py * *dy + 1;
*dx = (matrix->xx * *dx + matrix->xy * *dy) / new_p;
- *dy = (matrix->yx * *dx + matrix->yy * *dy) / new_p;
+ *dy = (matrix->yx * old_x + matrix->yy * *dy) / new_p;
}
slim_hidden_def(cairo_matrix_transform_distance);
@@ -435,10 +434,11 @@ void
cairo_matrix_transform_point (const cairo_matrix_t *matrix, double *x, double *y)
{
double new_p;
+ double old_x = *x;
new_p = matrix->px * *x + matrix->py * *y + 1;
*x = (matrix->xx * *x + matrix->xy * *y + matrix->x0) / new_p;
- *y = (matrix->yx * *x + matrix->yy * *y + matrix->y0) / new_p;
+ *y = (matrix->yx * old_x + matrix->yy * *y + matrix->y0) / new_p;
}
slim_hidden_def(cairo_matrix_transform_point);