diff options
author | David Reveman <davidr@novell.com> | 2006-01-05 05:06:50 +0000 |
---|---|---|
committer | David Reveman <davidr@novell.com> | 2006-01-05 05:06:50 +0000 |
commit | 5ac6e85455fce862989033d5ff98576d159664bd (patch) | |
tree | 6b71d223d4dbaccbfba9d8b8c38a4c2cc88346a2 | |
parent | 9737b4de39162a86844e07f50aa76e881063dab9 (diff) |
Update gradient code in PDF backend
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/cairo-pdf-surface.c | 30 |
2 files changed, 20 insertions, 15 deletions
@@ -1,3 +1,8 @@ +2006-01-05 David Reveman <davidr@novell.com> + + * src/cairo-pdf-surface.c (emit_pattern_stops) + (emit_linear_pattern, emit_radial_pattern): Track gradient changes. + 2006-01-04 Carl Worth <cworth@cworth.org> * Originally: 2005-10-10 David Reveman <davidr@novell.com> diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index db5efee0..086e5270 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -971,11 +971,11 @@ emit_pattern_stops (cairo_pdf_surface_t *surface, cairo_gradient_pattern_t *patt n_stops = pattern->n_stops; for (i = 0; i < pattern->n_stops; i++) { - stops[i].color_char[0] = pattern->stops[i].color.red * 0xff + 0.5; - stops[i].color_char[1] = pattern->stops[i].color.green * 0xff + 0.5; - stops[i].color_char[2] = pattern->stops[i].color.blue * 0xff + 0.5; - stops[i].color_char[3] = pattern->stops[i].color.alpha * 0xff + 0.5; - stops[i].offset = _cairo_fixed_to_double (pattern->stops[i].offset); + stops[i].color_char[0] = pattern->stops[i].color.red >> 8; + stops[i].color_char[1] = pattern->stops[i].color.green >> 8; + stops[i].color_char[2] = pattern->stops[i].color.blue >> 8; + stops[i].color_char[3] = pattern->stops[i].color.alpha >> 8; + stops[i].offset = _cairo_fixed_to_double (pattern->stops[i].x); stops[i].id = i; } @@ -1033,11 +1033,11 @@ emit_linear_pattern (cairo_pdf_surface_t *surface, cairo_linear_pattern_t *patte p2u = pattern->base.base.matrix; cairo_matrix_invert (&p2u); - x0 = pattern->point0.x; - y0 = pattern->point0.y; + x0 = _cairo_fixed_to_double (pattern->gradient.p1.x); + y0 = _cairo_fixed_to_double (pattern->gradient.p1.y); cairo_matrix_transform_point (&p2u, &x0, &y0); - x1 = pattern->point1.x; - y1 = pattern->point1.y; + x1 = _cairo_fixed_to_double (pattern->gradient.p2.x); + y1 = _cairo_fixed_to_double (pattern->gradient.p2.y); cairo_matrix_transform_point (&p2u, &x1, &y1); pattern_id = _cairo_pdf_document_new_object (document); @@ -1091,13 +1091,13 @@ emit_radial_pattern (cairo_pdf_surface_t *surface, cairo_radial_pattern_t *patte p2u = pattern->base.base.matrix; cairo_matrix_invert (&p2u); - x0 = pattern->center0.x; - y0 = pattern->center0.y; - r0 = pattern->radius0; + x0 = _cairo_fixed_to_double (pattern->gradient.inner.x); + y0 = _cairo_fixed_to_double (pattern->gradient.inner.y); + r0 = _cairo_fixed_to_double (pattern->gradient.inner.radius); cairo_matrix_transform_point (&p2u, &x0, &y0); - x1 = pattern->center1.x; - y1 = pattern->center1.y; - r1 = pattern->radius1; + x1 = _cairo_fixed_to_double (pattern->gradient.outer.x); + y1 = _cairo_fixed_to_double (pattern->gradient.outer.y); + r1 = _cairo_fixed_to_double (pattern->gradient.outer.radius); cairo_matrix_transform_point (&p2u, &x1, &y1); /* FIXME: This is surely crack, but how should you scale a radius |