mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 09:58:12 +02:00
PDF: Remove radial gradient fallback
when one circle not inside the other. Pixman now follows the PDF specification.
This commit is contained in:
parent
34d9299624
commit
d3655e04b2
1 changed files with 1 additions and 16 deletions
|
|
@ -5350,27 +5350,12 @@ _gradient_pattern_supported (const cairo_pattern_t *pattern)
|
|||
|
||||
|
||||
/* Radial gradients are currently only supported with EXTEND_NONE
|
||||
* and EXTEND_PAD and when one circle is inside the other. */
|
||||
* and EXTEND_PAD. */
|
||||
if (pattern->type == CAIRO_PATTERN_TYPE_RADIAL) {
|
||||
double x1, y1, x2, y2, r1, r2, d;
|
||||
cairo_radial_pattern_t *radial = (cairo_radial_pattern_t *) pattern;
|
||||
|
||||
if (extend == CAIRO_EXTEND_REPEAT ||
|
||||
extend == CAIRO_EXTEND_REFLECT) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
x1 = _cairo_fixed_to_double (radial->c1.x);
|
||||
y1 = _cairo_fixed_to_double (radial->c1.y);
|
||||
r1 = _cairo_fixed_to_double (radial->r1);
|
||||
x2 = _cairo_fixed_to_double (radial->c2.x);
|
||||
y2 = _cairo_fixed_to_double (radial->c2.y);
|
||||
r2 = _cairo_fixed_to_double (radial->r2);
|
||||
|
||||
d = sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));
|
||||
if (d > fabs(r2 - r1)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue