diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-06-01 09:07:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-06-01 09:11:47 +0300 |
commit | 1c292c97305c07ea16188280851527b17028a636 (patch) | |
tree | 30de6ea8ddd8f74d70c6741d1fe1ff7bf46a340b /source/blender/editors/interface | |
parent | d85271572b4d4c558f756d91e48df281808e84ab (diff) |
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.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 2bbd5b8dde8..d4d3e1af1fd 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); |