mirror of https://github.com/GNOME/gimp.git
fixed div-by-zero when using custom gradients with offset 100
rayl@netrover.com
This commit is contained in:
parent
c6663bee44
commit
a07e23927d
|
@ -891,6 +891,8 @@ gradient_calc_square_factor (double dist,
|
|||
|
||||
if (rat < offset)
|
||||
rat = 0.0;
|
||||
else if (offset == 1)
|
||||
rat = (rat>=1) ? 1 : 0;
|
||||
else
|
||||
rat = (rat - offset) / (1.0 - offset);
|
||||
} /* else */
|
||||
|
@ -923,6 +925,8 @@ gradient_calc_radial_factor (double dist,
|
|||
|
||||
if (rat < offset)
|
||||
rat = 0.0;
|
||||
else if (offset == 1)
|
||||
rat = (rat>=1) ? 1 : 0;
|
||||
else
|
||||
rat = (rat - offset) / (1.0 - offset);
|
||||
} /* else */
|
||||
|
@ -979,6 +983,8 @@ gradient_calc_bilinear_factor (double dist,
|
|||
|
||||
if (fabs(rat) < offset)
|
||||
rat = 0.0;
|
||||
else if (offset == 1)
|
||||
rat = (rat>=1) ? 1 : 0;
|
||||
else
|
||||
rat = (fabs(rat) - offset) / (1.0 - offset);
|
||||
} /* else */
|
||||
|
|
|
@ -891,6 +891,8 @@ gradient_calc_square_factor (double dist,
|
|||
|
||||
if (rat < offset)
|
||||
rat = 0.0;
|
||||
else if (offset == 1)
|
||||
rat = (rat>=1) ? 1 : 0;
|
||||
else
|
||||
rat = (rat - offset) / (1.0 - offset);
|
||||
} /* else */
|
||||
|
@ -923,6 +925,8 @@ gradient_calc_radial_factor (double dist,
|
|||
|
||||
if (rat < offset)
|
||||
rat = 0.0;
|
||||
else if (offset == 1)
|
||||
rat = (rat>=1) ? 1 : 0;
|
||||
else
|
||||
rat = (rat - offset) / (1.0 - offset);
|
||||
} /* else */
|
||||
|
@ -979,6 +983,8 @@ gradient_calc_bilinear_factor (double dist,
|
|||
|
||||
if (fabs(rat) < offset)
|
||||
rat = 0.0;
|
||||
else if (offset == 1)
|
||||
rat = (rat>=1) ? 1 : 0;
|
||||
else
|
||||
rat = (fabs(rat) - offset) / (1.0 - offset);
|
||||
} /* else */
|
||||
|
|
|
@ -891,6 +891,8 @@ gradient_calc_square_factor (double dist,
|
|||
|
||||
if (rat < offset)
|
||||
rat = 0.0;
|
||||
else if (offset == 1)
|
||||
rat = (rat>=1) ? 1 : 0;
|
||||
else
|
||||
rat = (rat - offset) / (1.0 - offset);
|
||||
} /* else */
|
||||
|
@ -923,6 +925,8 @@ gradient_calc_radial_factor (double dist,
|
|||
|
||||
if (rat < offset)
|
||||
rat = 0.0;
|
||||
else if (offset == 1)
|
||||
rat = (rat>=1) ? 1 : 0;
|
||||
else
|
||||
rat = (rat - offset) / (1.0 - offset);
|
||||
} /* else */
|
||||
|
@ -979,6 +983,8 @@ gradient_calc_bilinear_factor (double dist,
|
|||
|
||||
if (fabs(rat) < offset)
|
||||
rat = 0.0;
|
||||
else if (offset == 1)
|
||||
rat = (rat>=1) ? 1 : 0;
|
||||
else
|
||||
rat = (fabs(rat) - offset) / (1.0 - offset);
|
||||
} /* else */
|
||||
|
|
|
@ -891,6 +891,8 @@ gradient_calc_square_factor (double dist,
|
|||
|
||||
if (rat < offset)
|
||||
rat = 0.0;
|
||||
else if (offset == 1)
|
||||
rat = (rat>=1) ? 1 : 0;
|
||||
else
|
||||
rat = (rat - offset) / (1.0 - offset);
|
||||
} /* else */
|
||||
|
@ -923,6 +925,8 @@ gradient_calc_radial_factor (double dist,
|
|||
|
||||
if (rat < offset)
|
||||
rat = 0.0;
|
||||
else if (offset == 1)
|
||||
rat = (rat>=1) ? 1 : 0;
|
||||
else
|
||||
rat = (rat - offset) / (1.0 - offset);
|
||||
} /* else */
|
||||
|
@ -979,6 +983,8 @@ gradient_calc_bilinear_factor (double dist,
|
|||
|
||||
if (fabs(rat) < offset)
|
||||
rat = 0.0;
|
||||
else if (offset == 1)
|
||||
rat = (rat>=1) ? 1 : 0;
|
||||
else
|
||||
rat = (fabs(rat) - offset) / (1.0 - offset);
|
||||
} /* else */
|
||||
|
|
Loading…
Reference in New Issue