Fix [#21520] Using sample tool from color ramp sets alpha to 0
authorMatt Ebb <matt@mke3.net>
Wed, 10 Mar 2010 01:59:50 +0000 (01:59 +0000)
committerMatt Ebb <matt@mke3.net>
Wed, 10 Mar 2010 01:59:50 +0000 (01:59 +0000)
source/blender/editors/interface/interface_ops.c

index d66288c..a8478d2 100644 (file)
@@ -94,15 +94,16 @@ 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);
-       glReadPixels(mx, my, 1, 1, GL_RGB, GL_FLOAT, col);
-       glReadBuffer(GL_BACK);
-       
        if(RNA_property_type(eye->prop) == PROP_FLOAT) {
+               const int color_manage = CTX_data_scene(C)->r.color_mgt_flag & R_COLOR_MANAGEMENT;
+               float col[4];
+       
+               RNA_property_float_get_array(&eye->ptr, eye->prop, col);
                
+               glReadBuffer(GL_FRONT);
+               glReadPixels(mx, my, 1, 1, GL_RGB, GL_FLOAT, col);
+               glReadBuffer(GL_BACK);
+       
                if (RNA_property_array_length(&eye->ptr, eye->prop) < 3) return;
 
                /* convert from screen (srgb) space to linear rgb space */