Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/interface/interface_handlers.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index ef1bc3374d0..2d3a6181f09 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -6096,23 +6096,23 @@ static bool ui_numedit_but_HSVCUBE(uiBut *but,
}
#ifdef WITH_INPUT_NDOF
-static void ui_ndofedit_but_HSVCUBE(uiBut *but,
+static void ui_ndofedit_but_HSVCUBE(uiButHSVCube *hsv_but,
uiHandleButtonData *data,
const wmNDOFMotionData *ndof,
const enum eSnapType snap,
const bool shift)
{
- ColorPicker *cpicker = but->custom_data;
+ ColorPicker *cpicker = hsv_but->but.custom_data;
float *hsv = cpicker->color_data;
- const float hsv_v_max = max_ff(hsv[2], but->softmax);
+ const float hsv_v_max = max_ff(hsv[2], hsv_but->but.softmax);
float rgb[3];
float sensitivity = (shift ? 0.15f : 0.3f) * ndof->dt;
- ui_but_v3_get(but, rgb);
- ui_scene_linear_to_color_picker_space(but, rgb);
- ui_rgb_to_color_picker_HSVCUBE_compat_v(but, rgb, hsv);
+ ui_but_v3_get(&hsv_but->but, rgb);
+ ui_scene_linear_to_color_picker_space(&hsv_but->but, rgb);
+ ui_rgb_to_color_picker_HSVCUBE_compat_v(hsv_but, rgb, hsv);
- switch ((int)but->a1) {
+ switch (hsv_but->gradient_type) {
case UI_GRAD_SV:
hsv[1] += ndof->rvec[2] * sensitivity;
hsv[2] += ndof->rvec[0] * sensitivity;
@@ -6141,7 +6141,7 @@ static void ui_ndofedit_but_HSVCUBE(uiBut *but,
/* exception only for value strip - use the range set in but->min/max */
hsv[2] += ndof->rvec[0] * sensitivity;
- CLAMP(hsv[2], but->softmin, but->softmax);
+ CLAMP(hsv[2], hsv_but->but.softmin, hsv_but->but.softmax);
break;
default:
assert(!"invalid hsv type");
@@ -6149,7 +6149,7 @@ static void ui_ndofedit_but_HSVCUBE(uiBut *but,
}
if (snap != SNAP_OFF) {
- if (ELEM((int)but->a1, UI_GRAD_HV, UI_GRAD_HS, UI_GRAD_H)) {
+ if (ELEM(hsv_but->gradient_type, UI_GRAD_HV, UI_GRAD_HS, UI_GRAD_H)) {
ui_color_snap_hue(snap, &hsv[0]);
}
}
@@ -6157,18 +6157,18 @@ static void ui_ndofedit_but_HSVCUBE(uiBut *but,
/* ndof specific: the changes above aren't clamping */
hsv_clamp_v(hsv, hsv_v_max);
- ui_color_picker_to_rgb_HSVCUBE_v(but, hsv, rgb);
- ui_color_picker_to_scene_linear_space(but, rgb);
+ ui_color_picker_to_rgb_HSVCUBE_v(hsv_but, hsv, rgb);
+ ui_color_picker_to_scene_linear_space(&hsv_but->but, rgb);
copy_v3_v3(data->vec, rgb);
- ui_but_v3_set(but, data->vec);
+ ui_but_v3_set(&hsv_but->but, data->vec);
}
#endif /* WITH_INPUT_NDOF */
static int ui_do_but_HSVCUBE(
bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
{
- const uiButHSVCube *hsv_but = (uiButHSVCube *)but;
+ uiButHSVCube *hsv_but = (uiButHSVCube *)but;
int mx, my;
mx = event->x;
@@ -6197,7 +6197,7 @@ static int ui_do_but_HSVCUBE(
const wmNDOFMotionData *ndof = event->customdata;
const enum eSnapType snap = ui_event_to_snap(event);
- ui_ndofedit_but_HSVCUBE(but, data, ndof, snap, event->shift != 0);
+ ui_ndofedit_but_HSVCUBE(hsv_but, data, ndof, snap, event->shift != 0);
button_activate_state(C, but, BUTTON_STATE_EXIT);
ui_apply_but(C, but->block, but, data, true);