Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Eagar <joeedh@gmail.com>2022-04-11 20:24:01 +0300
committerJoseph Eagar <joeedh@gmail.com>2022-04-11 20:24:01 +0300
commita99639792b1628493139eb9943ae4befbdc6b613 (patch)
treef3e3a9f70838baa2de53bad217866c2ac71db42a
parent7163db99c4d8b908fb2c7c7768754b91cac0eb5e (diff)
Fix T97097: Color Filter saturates colors that have no saturation
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_filter_color.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_color.c b/source/blender/editors/sculpt_paint/sculpt_filter_color.c
index ebebd9efd80..a5bd87117fc 100644
--- a/source/blender/editors/sculpt_paint/sculpt_filter_color.c
+++ b/source/blender/editors/sculpt_paint/sculpt_filter_color.c
@@ -129,8 +129,14 @@ static void color_filter_task_cb(void *__restrict userdata,
break;
case COLOR_FILTER_SATURATION:
rgb_to_hsv_v(orig_color, hsv_color);
- hsv_color[1] = clamp_f(hsv_color[1] + fade, 0.0f, 1.0f);
- hsv_to_rgb_v(hsv_color, final_color);
+
+ if (hsv_color[1] != 0.0f) {
+ hsv_color[1] = clamp_f(hsv_color[1] + fade, 0.0f, 1.0f);
+ hsv_to_rgb_v(hsv_color, final_color);
+ }
+ else {
+ copy_v3_v3(final_color, orig_color);
+ }
break;
case COLOR_FILTER_VALUE:
rgb_to_hsv_v(orig_color, hsv_color);