From af8cb99b10b03df02ff5334a809239ee4c6d6ae2 Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Mon, 29 Sep 2025 19:13:56 +0200 Subject: [PATCH] Paint: Add asserts for BKE_brush_curve_strength Neither the `distance` or `brush_radius` parameters make sense to be negative and can cause odd behaviors. Pull Request: https://projects.blender.org/blender/blender/pulls/146698 --- source/blender/blenkernel/intern/brush.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/blenkernel/intern/brush.cc b/source/blender/blenkernel/intern/brush.cc index 01c260f7f9d..eca7bbd4d75 100644 --- a/source/blender/blenkernel/intern/brush.cc +++ b/source/blender/blenkernel/intern/brush.cc @@ -1569,6 +1569,9 @@ float BKE_brush_curve_strength(const eBrushCurvePreset preset, const float distance, const float brush_radius) { + BLI_assert(distance >= 0.0f); + BLI_assert(brush_radius >= 0.0f); + float p = distance; float strength = 1.0f;