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:
authorSebastian Parborg <zeddb>2018-12-17 21:13:30 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-12-17 21:18:16 +0300
commit1eafa91f647143b565914b71480bb90cd941e0ed (patch)
treea01791be6a50c02d162e9b9a916c5ac5bf72fc97 /source/blender/blenlib/intern/math_color.c
parentf6a77a759bbbe407d0c38dbd0002db685c569b86 (diff)
Fix T59424: color wheel snaps to center, losing hue when value is zero.
Differential Revision: https://developer.blender.org/D4090
Diffstat (limited to 'source/blender/blenlib/intern/math_color.c')
-rw-r--r--source/blender/blenlib/intern/math_color.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index 09a5762e4e0..91d733e9691 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -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;
}