Fix #105341 Hard freeze in scene space stroke code

Note: the entire paint stroke code needs to be rewritten to
work properly in world space.  At least it now freezes in
one less edge case.
This commit is contained in:
2023-03-04 04:08:18 -08:00
parent 89c3ead7c6
commit 5a4872bd4e

View File

@@ -723,6 +723,12 @@ static float paint_space_stroke_spacing(bContext *C,
static float paint_stroke_overlapped_curve(Brush *br, float x, float spacing)
{
/* Avoid division by small numbers, can happen
* on some pen setups. See #105341.
*/
spacing = max_ff(spacing, 0.1f);
const int n = 100 / spacing;
const float h = spacing / 50.0f;
const float x0 = x - 1;