COW operators: Fix drag and dropping of color properties
This commit is contained in:
@@ -1780,23 +1780,20 @@ static bool ui_but_drag_init(
|
||||
|
||||
/* TODO support more button pointer types */
|
||||
if (but->rnaprop && RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) {
|
||||
RNA_property_float_get_array(&but->rnapoin, but->rnaprop, drag_info->color);
|
||||
ui_but_v3_get(but, drag_info->color);
|
||||
drag_info->gamma_corrected = true;
|
||||
valid = true;
|
||||
}
|
||||
else if (but->rnaprop && RNA_property_subtype(but->rnaprop) == PROP_COLOR) {
|
||||
RNA_property_float_get_array(&but->rnapoin, but->rnaprop, drag_info->color);
|
||||
ui_but_v3_get(but, drag_info->color);
|
||||
drag_info->gamma_corrected = false;
|
||||
valid = true;
|
||||
}
|
||||
else if (but->pointype == UI_BUT_POIN_FLOAT) {
|
||||
else if (ELEM(but->pointype, UI_BUT_POIN_FLOAT, UI_BUT_POIN_CHAR)) {
|
||||
ui_but_v3_get(but, drag_info->color);
|
||||
copy_v3_v3(drag_info->color, (float *)but->poin);
|
||||
valid = true;
|
||||
}
|
||||
else if (but->pointype == UI_BUT_POIN_CHAR) {
|
||||
rgb_uchar_to_float(drag_info->color, (unsigned char *)but->poin);
|
||||
valid = true;
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
WM_event_start_drag(C, ICON_COLOR, WM_DRAG_COLOR, drag_info, 0.0, WM_DRAG_FREE_DATA);
|
||||
|
||||
Reference in New Issue
Block a user