Commit: 1c292c97305c07ea16188280851527b17028a636
Author: Campbell Barton
Date:   Wed Jun 1 16:07:11 2016 +1000
Branches: master
https://developer.blender.org/rB1c292c97305c07ea16188280851527b17028a636

Fix/Workaround T48560: Color picker V fail w/ user defined RNA

Set the maximum soft-max to 1.0 when its left at FLT_MAX.
Since this causes problems using the slider.

===================================================================

M       source/blender/editors/interface/interface_regions.c

===================================================================

diff --git a/source/blender/editors/interface/interface_regions.c 
b/source/blender/editors/interface/interface_regions.c
index 2bbd5b8..d4d3e1a 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -2327,6 +2327,12 @@ static void ui_block_colorpicker(uiBlock *block, float 
rgba[4], PointerRNA *ptr,
        RNA_property_float_range(ptr, prop, &hardmin, &hardmax);
        RNA_property_float_get_array(ptr, prop, rgba);
 
+       /* when the softmax isn't defined in the RNA,
+        * using very large numbers causes sRGB/linear round trip to fail. */
+       if (softmax == FLT_MAX) {
+               softmax = 1.0f;
+       }
+
        switch (U.color_picker_type) {
                case USER_CP_SQUARE_SV:
                        ui_colorpicker_square(block, ptr, prop, UI_GRAD_SV, 
cpicker);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to