Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_region_color_picker.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| float add = 0.0f; | float add = 0.0f; | ||||
| if (event->type == WHEELUPMOUSE) { | if (event->type == WHEELUPMOUSE) { | ||||
| add = 0.05f; | add = 0.05f; | ||||
| } | } | ||||
| else if (event->type == WHEELDOWNMOUSE) { | else if (event->type == WHEELDOWNMOUSE) { | ||||
| add = -0.05f; | add = -0.05f; | ||||
| } | } | ||||
| else if (event->type == MOUSEPAN) { | |||||
| const int invert = (U.uiflag2 & USER_TRACKPAD_NATURAL) ? 1 : -1; | |||||
| add = 0.005f * invert * (event->y - event->prevy); | |||||
| } | |||||
| if (add != 0.0f) { | if (add != 0.0f) { | ||||
| LISTBASE_FOREACH (uiBut *, but, &block->buttons) { | LISTBASE_FOREACH (uiBut *, but, &block->buttons) { | ||||
| if (but->type == UI_BTYPE_HSVCUBE && but->active == NULL) { | if (but->type == UI_BTYPE_HSVCUBE && but->active == NULL) { | ||||
| uiPopupBlockHandle *popup = block->handle; | uiPopupBlockHandle *popup = block->handle; | ||||
| float rgb[3]; | float rgb[3]; | ||||
| ColorPicker *cpicker = but->custom_data; | ColorPicker *cpicker = but->custom_data; | ||||
| float *hsv = cpicker->color_data; | float *hsv = cpicker->color_data; | ||||
| ▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines | |||||