diff options
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index ce64a7e21a2..0ebe079703b 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -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); |