Fix 101000: color picker colors drift above 1 for some OCIO configurations

Increase threshold to avoid float precision issues.
This commit is contained in:
Brecht Van Lommel 2022-09-16 14:52:04 +02:00
parent bf05b998b6
commit 2eb19eeb19
Notes: blender-bot 2023-02-14 02:27:56 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
Referenced by issue #101000, Color picker colors drift value for some OCIO configurations
1 changed files with 2 additions and 2 deletions

View File

@ -52,10 +52,10 @@ static void ui_color_picker_rgb_round(float rgb[3])
* all color space conversions would be expensive, but for the color picker
* we can do the extra work. */
for (int i = 0; i < 3; i++) {
if (fabsf(rgb[i]) < 1e-6f) {
if (fabsf(rgb[i]) < 5e-5f) {
rgb[i] = 0.0f;
}
else if (fabsf(1.0f - rgb[i]) < 1e-6f) {
else if (fabsf(1.0f - rgb[i]) < 5e-5f) {
rgb[i] = 1.0f;
}
}