diff options
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_filter_color.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_filter_color.c | 10 |
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); |