[Bf-blender-cvs] [b50c1ca8fe2] blender-v3.3-release: Fix 101000: color picker colors drift above 1 for some OCIO configurations
Brecht Van Lommel
noreply at git.blender.org
Wed Sep 21 14:27:10 CEST 2022
Commit: b50c1ca8fe2f44ed01b281406330aa13d3583e71
Author: Brecht Van Lommel
Date: Fri Sep 16 14:52:04 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rBb50c1ca8fe2f44ed01b281406330aa13d3583e71
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