forked from bartvdbraak/blender
Fix [#21520] Using sample tool from color ramp sets alpha to 0
This commit is contained in:
parent
2df08632cd
commit
a550de158e
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user