Radial gradients are conceptually rendered as a sequence of circles
generated by linearly extrapolating from the two circles given by the
gradient specification. Any circles in that sequence that would end up
with a negative radius are not drawn, a condition that is enforced by
checking that t * dr is bigger than mindr:
if (t * dr > mindr)
However, it is legitimate for a circle to have radius exactly 0, so
the test should use >= rather than >.
This gets rid of the dots in demos/radial-test except for when the c2
circle has radius 0 and a repeat mode of either NONE or NORMAL. Both
those dots correspond to a t value of 1.0, which is outside the
defined interval of [0.0, 1.0) and therefore subject to the repeat
algorithm. As a result, in the NONE case, a value of 1.0 turns into
transparent black. In the NORMAL case, 1.0 wraps around and becomes
0.0 which is red, unlike 0.99 which is blue.
Cc: ranma42@gmail.com
}
else
{
- if (t * dr > mindr)
+ if (t * dr >= mindr)
return _pixman_gradient_walker_pixel (walker, t);
}
}
else
{
- if (t0 * dr > mindr)
+ if (t0 * dr >= mindr)
return _pixman_gradient_walker_pixel (walker, t0);
- else if (t1 * dr > mindr)
+ else if (t1 * dr >= mindr)
return _pixman_gradient_walker_pixel (walker, t1);
}
}