Fix: GPv3: Division by zero for single point curves
Makes sure to map curves with a single point to 0.0f in the custom curve mapping.
This commit is contained in:
@@ -131,7 +131,7 @@ static void deform_drawing(const ModifierData &md,
|
||||
(mmd.influence.custom_curve))
|
||||
{
|
||||
/* Normalize value to evaluate curve. */
|
||||
const float value = float(i) / (points.size() - 1);
|
||||
const float value = points.size() > 1 ? (float(i) / float(points.size() - 1)) : 0.0f;
|
||||
return BKE_curvemapping_evaluateF(mmd.influence.custom_curve, 0, value);
|
||||
}
|
||||
return 1.0f;
|
||||
|
||||
Reference in New Issue
Block a user