diff options
author | Matt Ebb <matt@mke3.net> | 2010-03-09 05:29:59 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-03-09 05:29:59 +0300 |
commit | 417c328874746d4c77f75eaf146da5414ee87958 (patch) | |
tree | 9839fda5a8d4f6576507ce0ff7629043eb5eb8b1 /source/blender/editors/interface/interface_ops.c | |
parent | ca43a2a87fee9634baf8aa9c526b99bfcd44ec87 (diff) |
Fix [#21047] Sample color too dark when not using color managment
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r-- | source/blender/editors/interface/interface_ops.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index c23e7f86833..d66288c8523 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -94,6 +94,7 @@ static int eyedropper_cancel(bContext *C, wmOperator *op) static void eyedropper_sample(bContext *C, Eyedropper *eye, short mx, short my) { + const int color_manage = CTX_data_scene(C)->r.color_mgt_flag & R_COLOR_MANAGEMENT; float col[3]; glReadBuffer(GL_FRONT); @@ -101,11 +102,11 @@ static void eyedropper_sample(bContext *C, Eyedropper *eye, short mx, short my) glReadBuffer(GL_BACK); if(RNA_property_type(eye->prop) == PROP_FLOAT) { - + if (RNA_property_array_length(&eye->ptr, eye->prop) < 3) return; /* convert from screen (srgb) space to linear rgb space */ - if (RNA_property_subtype(eye->prop) == PROP_COLOR) + if (color_manage && RNA_property_subtype(eye->prop) == PROP_COLOR) srgb_to_linearrgb_v3_v3(col, col); RNA_property_float_set_array(&eye->ptr, eye->prop, col); |