Fix T44093: Color picker SV+H order wrong.
Based on HSV ordering, SV+H had S<>V swapped.
This commit is contained in:
parent
befaf86a99
commit
e8b6d86f95
@ -4705,8 +4705,8 @@ static bool ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data,
|
|||||||
|
|
||||||
switch ((int)but->a1) {
|
switch ((int)but->a1) {
|
||||||
case UI_GRAD_SV:
|
case UI_GRAD_SV:
|
||||||
hsv[2] = x;
|
hsv[1] = x;
|
||||||
hsv[1] = y;
|
hsv[2] = y;
|
||||||
break;
|
break;
|
||||||
case UI_GRAD_HV:
|
case UI_GRAD_HV:
|
||||||
hsv[0] = x;
|
hsv[0] = x;
|
||||||
@ -4783,8 +4783,8 @@ static void ui_ndofedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data,
|
|||||||
|
|
||||||
switch ((int)but->a1) {
|
switch ((int)but->a1) {
|
||||||
case UI_GRAD_SV:
|
case UI_GRAD_SV:
|
||||||
hsv[2] += ndof->rvec[2] * sensitivity;
|
hsv[1] += ndof->rvec[2] * sensitivity;
|
||||||
hsv[1] += ndof->rvec[0] * sensitivity;
|
hsv[2] += ndof->rvec[0] * sensitivity;
|
||||||
break;
|
break;
|
||||||
case UI_GRAD_HV:
|
case UI_GRAD_HV:
|
||||||
hsv[0] += ndof->rvec[2] * sensitivity;
|
hsv[0] += ndof->rvec[2] * sensitivity;
|
||||||
|
@ -2342,9 +2342,9 @@ void ui_draw_gradient(const rcti *rect, const float hsv[3], const int type, cons
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case UI_GRAD_SV:
|
case UI_GRAD_SV:
|
||||||
hsv_to_rgb(h, 0.0, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
|
hsv_to_rgb(h, 0.0, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
|
||||||
hsv_to_rgb(h, 0.333, 0.0, &col1[1][0], &col1[1][1], &col1[1][2]);
|
hsv_to_rgb(h, 0.0, 0.333, &col1[1][0], &col1[1][1], &col1[1][2]);
|
||||||
hsv_to_rgb(h, 0.666, 0.0, &col1[2][0], &col1[2][1], &col1[2][2]);
|
hsv_to_rgb(h, 0.0, 0.666, &col1[2][0], &col1[2][1], &col1[2][2]);
|
||||||
hsv_to_rgb(h, 1.0, 0.0, &col1[3][0], &col1[3][1], &col1[3][2]);
|
hsv_to_rgb(h, 0.0, 1.0, &col1[3][0], &col1[3][1], &col1[3][2]);
|
||||||
break;
|
break;
|
||||||
case UI_GRAD_HV:
|
case UI_GRAD_HV:
|
||||||
hsv_to_rgb(0.0, s, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
|
hsv_to_rgb(0.0, s, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
|
||||||
@ -2399,10 +2399,10 @@ void ui_draw_gradient(const rcti *rect, const float hsv[3], const int type, cons
|
|||||||
/* new color */
|
/* new color */
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case UI_GRAD_SV:
|
case UI_GRAD_SV:
|
||||||
hsv_to_rgb(h, 0.0, dx, &col1[0][0], &col1[0][1], &col1[0][2]);
|
hsv_to_rgb(h, dx, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
|
||||||
hsv_to_rgb(h, 0.333, dx, &col1[1][0], &col1[1][1], &col1[1][2]);
|
hsv_to_rgb(h, dx, 0.333, &col1[1][0], &col1[1][1], &col1[1][2]);
|
||||||
hsv_to_rgb(h, 0.666, dx, &col1[2][0], &col1[2][1], &col1[2][2]);
|
hsv_to_rgb(h, dx, 0.666, &col1[2][0], &col1[2][1], &col1[2][2]);
|
||||||
hsv_to_rgb(h, 1.0, dx, &col1[3][0], &col1[3][1], &col1[3][2]);
|
hsv_to_rgb(h, dx, 1.0, &col1[3][0], &col1[3][1], &col1[3][2]);
|
||||||
break;
|
break;
|
||||||
case UI_GRAD_HV:
|
case UI_GRAD_HV:
|
||||||
hsv_to_rgb(dx_next, s, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
|
hsv_to_rgb(dx_next, s, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
|
||||||
@ -2485,7 +2485,7 @@ void ui_hsvcube_pos_from_vals(uiBut *but, const rcti *rect, float *hsv, float *x
|
|||||||
|
|
||||||
switch ((int)but->a1) {
|
switch ((int)but->a1) {
|
||||||
case UI_GRAD_SV:
|
case UI_GRAD_SV:
|
||||||
x = hsv[2]; y = hsv[1]; break;
|
x = hsv[1]; y = hsv[2]; break;
|
||||||
case UI_GRAD_HV:
|
case UI_GRAD_HV:
|
||||||
x = hsv[0]; y = hsv[2]; break;
|
x = hsv[0]; y = hsv[2]; break;
|
||||||
case UI_GRAD_HS:
|
case UI_GRAD_HS:
|
||||||
|
Loading…
Reference in New Issue
Block a user