diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-03-23 16:18:57 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-03-23 16:18:57 +0300 |
commit | e8b6d86f9514b86daefe6ee0182c57d794b603f9 (patch) | |
tree | 5213f5862a05bc50ef1f83ee25fe24c30870a37c /source/blender | |
parent | befaf86a9990aa0be24fcf713f3880da540ddb1c (diff) |
Fix T44093: Color picker SV+H order wrong.
Based on HSV ordering, SV+H had S<>V swapped.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 8 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 71b7b95208b..68a69c4cd4e 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -4705,8 +4705,8 @@ static bool ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, switch ((int)but->a1) { case UI_GRAD_SV: - hsv[2] = x; - hsv[1] = y; + hsv[1] = x; + hsv[2] = y; break; case UI_GRAD_HV: hsv[0] = x; @@ -4783,8 +4783,8 @@ static void ui_ndofedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, switch ((int)but->a1) { case UI_GRAD_SV: - hsv[2] += ndof->rvec[2] * sensitivity; - hsv[1] += ndof->rvec[0] * sensitivity; + hsv[1] += ndof->rvec[2] * sensitivity; + hsv[2] += ndof->rvec[0] * sensitivity; break; case UI_GRAD_HV: hsv[0] += ndof->rvec[2] * sensitivity; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 3d021e7dd10..0b3684ff755 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2342,9 +2342,9 @@ void ui_draw_gradient(const rcti *rect, const float hsv[3], const int type, cons switch (type) { 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.333, 0.0, &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, 1.0, 0.0, &col1[3][0], &col1[3][1], &col1[3][2]); + hsv_to_rgb(h, 0.0, 0.333, &col1[1][0], &col1[1][1], &col1[1][2]); + hsv_to_rgb(h, 0.0, 0.666, &col1[2][0], &col1[2][1], &col1[2][2]); + hsv_to_rgb(h, 0.0, 1.0, &col1[3][0], &col1[3][1], &col1[3][2]); break; case UI_GRAD_HV: 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 */ switch (type) { case UI_GRAD_SV: - hsv_to_rgb(h, 0.0, dx, &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, 0.666, dx, &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, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]); + hsv_to_rgb(h, dx, 0.333, &col1[1][0], &col1[1][1], &col1[1][2]); + hsv_to_rgb(h, dx, 0.666, &col1[2][0], &col1[2][1], &col1[2][2]); + hsv_to_rgb(h, dx, 1.0, &col1[3][0], &col1[3][1], &col1[3][2]); break; case UI_GRAD_HV: 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) { case UI_GRAD_SV: - x = hsv[2]; y = hsv[1]; break; + x = hsv[1]; y = hsv[2]; break; case UI_GRAD_HV: x = hsv[0]; y = hsv[2]; break; case UI_GRAD_HS: |