[Bf-blender-cvs] [807e98b] compositor-2016: Fix/Workaround T48560: Color picker V fail w/ user defined RNA

Campbell Barton noreply at git.blender.org
Wed Jun 8 21:52:02 CEST 2016


Commit: 807e98bb479dd701338cd2c4c2c0b8094ddd0413
Author: Campbell Barton
Date:   Wed Jun 1 16:07:11 2016 +1000
Branches: compositor-2016
https://developer.blender.org/rB807e98bb479dd701338cd2c4c2c0b8094ddd0413

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);




More information about the Bf-blender-cvs mailing list