mirror of https://github.com/GNOME/gimp.git
app: improve curved gradient segment sampling
Improve the sampling performance of curved gradient segments, and its behavior when the segment's midpoint is close to one of its limits.
This commit is contained in:
parent
1b2a395e88
commit
1f3030eb41
|
@ -2179,9 +2179,11 @@ gimp_gradient_calc_curved_factor (gdouble middle,
|
|||
gdouble pos)
|
||||
{
|
||||
if (middle < EPSILON)
|
||||
middle = EPSILON;
|
||||
return 1.0;
|
||||
else if (1.0 - middle < EPSILON)
|
||||
return 0.0;
|
||||
|
||||
return pow (pos, log (0.5) / log (middle));
|
||||
return exp (-G_LN2 * log (pos) / log (middle));
|
||||
}
|
||||
|
||||
static inline gdouble
|
||||
|
|
Loading…
Reference in New Issue