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:
authorCampbell Barton <ideasman42@gmail.com>2012-06-21 18:37:56 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-21 18:37:56 +0400
commit5def0b6c55d13b07bd59863174379110395e1fed (patch)
tree200766f14226d049ed858ac51108467bf28b9923 /source/blender/editors/interface
parentc896a9921371a01b95046dd3522a7758a4e9a878 (diff)
display a sample line in the hue correct, handy to sample the image to know what to change
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_draw.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index b797b5377e3..12c88a42888 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -1346,7 +1346,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
cumap = (CurveMapping *)(but->editcumap ? but->editcumap : but->poin);
cuma = cumap->cm + cumap->cur;
-
+
/* need scissor test, curve can draw outside of boundary */
glGetIntegerv(GL_VIEWPORT, scissor);
scissor_new.xmin = ar->winrct.xmin + rect->xmin;
@@ -1424,7 +1424,19 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
/* sample option */
if (cumap->flag & CUMA_DRAW_SAMPLE) {
- if (cumap->cur == 3) {
+ if (but->a1 == UI_GRAD_H) {
+ float tsample[3];
+ float hsv[3];
+ linearrgb_to_srgb_v3_v3(tsample, cumap->sample);
+ rgb_to_hsv_v(tsample, hsv);
+ glColor3ub(240, 240, 240);
+
+ glBegin(GL_LINES);
+ glVertex2f(rect->xmin + zoomx * (hsv[0] - offsx), rect->ymin);
+ glVertex2f(rect->xmin + zoomx * (hsv[0] - offsx), rect->ymax);
+ glEnd();
+ }
+ else if (cumap->cur == 3) {
float lum = cumap->sample[0] * 0.35f + cumap->sample[1] * 0.45f + cumap->sample[2] * 0.2f;
glColor3ub(240, 240, 240);