Fix T59424: color wheel snaps to center, losing hue when value is zero.

Differential Revision: https://developer.blender.org/D4090
This commit is contained in:
Sebastian Parborg 2018-12-17 19:13:30 +01:00 committed by Brecht Van Lommel
parent f6a77a759b
commit 1eafa91f64
Notes: blender-bot 2023-02-14 04:27:41 +01:00
Referenced by issue #59793, bug
Referenced by issue #59424, Color wheel snaps to center: loosing hue if light value is down to zero.
1 changed files with 3 additions and 2 deletions

View File

@ -328,11 +328,12 @@ void rgb_to_hsv_compat(float r, float g, float b, float *lh, float *ls, float *l
rgb_to_hsv(r, g, b, lh, ls, lv);
if (*lv <= 0.0f) {
if (*lv <= 1e-8) {
/* Very low v values will affect the hs values, correct them in post. */
*lh = orig_h;
*ls = orig_s;
}
else if (*ls <= 0.0f) {
else if (*ls <= 1e-8) {
*lh = orig_h;
}