[Bf-blender-cvs] [2eb19eeb19a] master: Fix 101000: color picker colors drift above 1 for some OCIO configurations
Brecht Van Lommel
noreply at git.blender.org
Fri Sep 16 15:00:46 CEST 2022
Commit: 2eb19eeb19a77103d1f410004955cf17ca14abba
Author: Brecht Van Lommel
Date: Fri Sep 16 14:52:04 2022 +0200
Branches: master
https://developer.blender.org/rB2eb19eeb19a77103d1f410004955cf17ca14abba
Fix 101000: color picker colors drift above 1 for some OCIO configurations
Increase threshold to avoid float precision issues.
===================================================================
M source/blender/editors/interface/interface_region_color_picker.cc
===================================================================
diff --git a/source/blender/editors/interface/interface_region_color_picker.cc b/source/blender/editors/interface/interface_region_color_picker.cc
index db1e5e653de..72912b8c7f7 100644
--- a/source/blender/editors/interface/interface_region_color_picker.cc
+++ b/source/blender/editors/interface/interface_region_color_picker.cc
@@ -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;
}
}
More information about the Bf-blender-cvs
mailing list