Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_region_color_picker.c
| Show All 32 Lines | |||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "WM_api.h" | |||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| ▲ Show 20 Lines • Show All 84 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) { | |||||
| add = 0.005f * WM_event_absolute_delta_y(event) / U.dpi_fac; | |||||
| } | |||||
| 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 42 Lines • Show Last 20 Lines | |||||