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
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_handlers.c20
-rw-r--r--source/blender/editors/interface/interface_widgets.c8
2 files changed, 22 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 03c19f5e94b..d0cc2f1ceaa 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -4638,8 +4638,14 @@ static bool ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data,
/* exception, when using color wheel in 'locked' value state:
* allow choosing a hue for black values, by giving a tiny increment */
- if (but->flag & UI_BUT_COLOR_LOCK) { // lock
- if (hsv[2] == 0.f) hsv[2] = 0.0001f;
+ if (but->flag & UI_BUT_COLOR_LOCK) {
+ if (U.color_picker_type == USER_CP_CIRCLE_HSV) { // lock
+ if (hsv[2] == 0.f) hsv[2] = 0.0001f;
+ }
+ else {
+ if (hsv[2] == 0.f) hsv[2] = 0.0001f;
+ if (hsv[2] == 1.f) hsv[2] = 0.9999f;
+ }
}
/* only apply the delta motion, not absolute */
@@ -4727,8 +4733,14 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data,
/* exception, when using color wheel in 'locked' value state:
* allow choosing a hue for black values, by giving a tiny increment */
- if (but->flag & UI_BUT_COLOR_LOCK) { // lock
- if (hsv[2] == 0.0f) hsv[2] = 0.0001f;
+ if (but->flag & UI_BUT_COLOR_LOCK) {
+ if (U.color_picker_type == USER_CP_CIRCLE_HSV) { // lock
+ if (hsv[2] == 0.f) hsv[2] = 0.0001f;
+ }
+ else {
+ if (hsv[2] == 0.f) hsv[2] = 0.0001f;
+ if (hsv[2] == 1.f) hsv[2] = 0.9999f;
+ }
}
if (snap != SNAP_OFF) {
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 2eff3a359ba..9eb39f67831 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2071,8 +2071,12 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti *
/* exception: if 'lock' is set
* lock the value of the color wheel to 1.
* Useful for color correction tools where you're only interested in hue. */
- if (but->flag & UI_BUT_COLOR_LOCK)
- hsv[2] = 1.f;
+ if (but->flag & UI_BUT_COLOR_LOCK) {
+ if(U.color_picker_type == USER_CP_CIRCLE_HSV)
+ hsv[2] = 1.f;
+ else
+ hsv[2] = 0.5f;
+ }
ui_color_picker_to_rgb(0.f, 0.f, hsv[2], colcent, colcent + 1, colcent + 2);