diff options
author | Emmanuel Pacaud <emmanuel.pacaud@free.fr> | 2007-03-08 21:32:59 +0100 |
---|---|---|
committer | Emmanuel Pacaud <emmanuel.pacaud@free.fr> | 2007-03-08 21:32:59 +0100 |
commit | 772edc9133d41dfd667ae5915dfa6ace0bcbfd0d (patch) | |
tree | 63e6ee394ef9bbf3cf3da5da5afa3d701deeafd8 /src | |
parent | c07867c545d7ab7c4a104944768f8a5b69ef9596 (diff) |
SVG: fix a radial gradient failure when using CAIRO_EXTEND_REFLECT.
Assume from the beginning we're using a circle with a radius equal to
2 * ( r1 - r0 ) when emulating CAIRO_EXTEND_REFLECT.
Diffstat (limited to 'src')
-rw-r--r-- | src/cairo-svg-surface.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c index fdd49932..5cb9ce0b 100644 --- a/src/cairo-svg-surface.c +++ b/src/cairo-svg-surface.c @@ -1501,23 +1501,23 @@ _cairo_svg_surface_emit_radial_pattern (cairo_svg_surface_t *surface, if ((extend == CAIRO_EXTEND_REFLECT || extend == CAIRO_EXTEND_REPEAT) && r0 > 0.0) { - offset = fmod (r1, r1 - r0) / (r1 - r0) - 1.0; - r = r1 - r0; + double r_org = r1; if (extend == CAIRO_EXTEND_REFLECT) { - r *= 2.0; - offset *= 0.5; + r1 = 2 * r1 - r0; emulate_reflect = TRUE; } + offset = fmod (r1, r1 - r0) / (r1 - r0) - 1.0; + r = r1 - r0; + /* New position of outer circle. */ - x = r * (x1 - fx) / r1 + fx; - y = r * (y1 - fy) / r1 + fy; + x = r * (x1 - fx) / r_org + fx; + y = r * (y1 - fy) / r_org + fy; x1 = x; y1 = y; r1 = r; - r0 = 0.0; } else { offset = r0 / r1; |