hue correct node: draw hsv backdrop with full alpha.
This commit is contained in:
@@ -1310,7 +1310,7 @@ static void ui_draw_but_curve_grid(rcti *rect, float zoomx, float zoomy, float o
|
|||||||
fx = rect->xmin + zoomx * (-offsx);
|
fx = rect->xmin + zoomx * (-offsx);
|
||||||
if (fx > rect->xmin) fx -= dx * (floorf(fx - rect->xmin));
|
if (fx > rect->xmin) fx -= dx * (floorf(fx - rect->xmin));
|
||||||
while (fx < rect->xmax) {
|
while (fx < rect->xmax) {
|
||||||
glVertex2f(fx, rect->ymin);
|
glVertex2f(fx, rect->ymin);
|
||||||
glVertex2f(fx, rect->ymax);
|
glVertex2f(fx, rect->ymax);
|
||||||
fx += dx;
|
fx += dx;
|
||||||
}
|
}
|
||||||
@@ -1319,7 +1319,7 @@ static void ui_draw_but_curve_grid(rcti *rect, float zoomx, float zoomy, float o
|
|||||||
fy = rect->ymin + zoomy * (-offsy);
|
fy = rect->ymin + zoomy * (-offsy);
|
||||||
if (fy > rect->ymin) fy -= dy * (floorf(fy - rect->ymin));
|
if (fy > rect->ymin) fy -= dy * (floorf(fy - rect->ymin));
|
||||||
while (fy < rect->ymax) {
|
while (fy < rect->ymax) {
|
||||||
glVertex2f(rect->xmin, fy);
|
glVertex2f(rect->xmin, fy);
|
||||||
glVertex2f(rect->xmax, fy);
|
glVertex2f(rect->xmax, fy);
|
||||||
fy += dy;
|
fy += dy;
|
||||||
}
|
}
|
||||||
@@ -1363,53 +1363,54 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
|
|||||||
offsy = cumap->curr.ymin - but->aspect / zoomy;
|
offsy = cumap->curr.ymin - but->aspect / zoomy;
|
||||||
|
|
||||||
/* backdrop */
|
/* backdrop */
|
||||||
if (cumap->flag & CUMA_DO_CLIP) {
|
if (but->a1 == UI_GRAD_H) {
|
||||||
gl_shaded_color((unsigned char *)wcol->inner, -20);
|
/* magic trigger for curve backgrounds */
|
||||||
glRectf(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
|
rcti grid;
|
||||||
glColor3ubv((unsigned char *)wcol->inner);
|
float col[3] = {0.0f, 0.0f, 0.0f}; /* dummy arg */
|
||||||
glRectf(rect->xmin + zoomx * (cumap->clipr.xmin - offsx),
|
|
||||||
rect->ymin + zoomy * (cumap->clipr.ymin - offsy),
|
grid.xmin = rect->xmin + zoomx * (-offsx);
|
||||||
rect->xmin + zoomx * (cumap->clipr.xmax - offsx),
|
grid.xmax = rect->xmax + zoomx * (-offsx);
|
||||||
rect->ymin + zoomy * (cumap->clipr.ymax - offsy));
|
grid.ymin = rect->ymin + zoomy * (-offsy);
|
||||||
|
grid.ymax = rect->ymax + zoomy * (-offsy);
|
||||||
|
|
||||||
|
ui_draw_gradient(&grid, col, UI_GRAD_H, 1.0f);
|
||||||
|
|
||||||
|
/* grid, hsv uses different grid */
|
||||||
|
gl_shaded_color((unsigned char *)wcol->inner, -16);
|
||||||
|
/* TODO, grid lines does not line up with colors, need to look into this */
|
||||||
|
ui_draw_but_curve_grid(rect, zoomx, zoomy, offsx, offsy, 0.25f / 2.0f);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
glColor3ubv((unsigned char *)wcol->inner);
|
if (cumap->flag & CUMA_DO_CLIP) {
|
||||||
glRectf(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
|
gl_shaded_color((unsigned char *)wcol->inner, -20);
|
||||||
}
|
glRectf(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
|
||||||
|
glColor3ubv((unsigned char *)wcol->inner);
|
||||||
/* grid, every 0.25 step */
|
glRectf(rect->xmin + zoomx * (cumap->clipr.xmin - offsx),
|
||||||
gl_shaded_color((unsigned char *)wcol->inner, -16);
|
rect->ymin + zoomy * (cumap->clipr.ymin - offsy),
|
||||||
ui_draw_but_curve_grid(rect, zoomx, zoomy, offsx, offsy, 0.25f);
|
rect->xmin + zoomx * (cumap->clipr.xmax - offsx),
|
||||||
/* grid, every 1.0 step */
|
rect->ymin + zoomy * (cumap->clipr.ymax - offsy));
|
||||||
gl_shaded_color((unsigned char *)wcol->inner, -24);
|
|
||||||
ui_draw_but_curve_grid(rect, zoomx, zoomy, offsx, offsy, 1.0f);
|
|
||||||
/* axes */
|
|
||||||
gl_shaded_color((unsigned char *)wcol->inner, -50);
|
|
||||||
glBegin(GL_LINES);
|
|
||||||
glVertex2f(rect->xmin, rect->ymin + zoomy * (-offsy));
|
|
||||||
glVertex2f(rect->xmax, rect->ymin + zoomy * (-offsy));
|
|
||||||
glVertex2f(rect->xmin + zoomx * (-offsx), rect->ymin);
|
|
||||||
glVertex2f(rect->xmin + zoomx * (-offsx), rect->ymax);
|
|
||||||
glEnd();
|
|
||||||
|
|
||||||
/* magic trigger for curve backgrounds */
|
|
||||||
if (but->a1 != -1) {
|
|
||||||
if (but->a1 == UI_GRAD_H) {
|
|
||||||
rcti grid;
|
|
||||||
float col[3] = {0.0f, 0.0f, 0.0f}; /* dummy arg */
|
|
||||||
|
|
||||||
grid.xmin = rect->xmin + zoomx * (-offsx);
|
|
||||||
grid.xmax = rect->xmax + zoomx * (-offsx);
|
|
||||||
grid.ymin = rect->ymin + zoomy * (-offsy);
|
|
||||||
grid.ymax = rect->ymax + zoomy * (-offsy);
|
|
||||||
|
|
||||||
glEnable(GL_BLEND);
|
|
||||||
ui_draw_gradient(&grid, col, UI_GRAD_H, 0.5f);
|
|
||||||
glDisable(GL_BLEND);
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
glColor3ubv((unsigned char *)wcol->inner);
|
||||||
|
glRectf(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* grid, every 0.25 step */
|
||||||
|
gl_shaded_color((unsigned char *)wcol->inner, -16);
|
||||||
|
ui_draw_but_curve_grid(rect, zoomx, zoomy, offsx, offsy, 0.25f);
|
||||||
|
/* grid, every 1.0 step */
|
||||||
|
gl_shaded_color((unsigned char *)wcol->inner, -24);
|
||||||
|
ui_draw_but_curve_grid(rect, zoomx, zoomy, offsx, offsy, 1.0f);
|
||||||
|
/* axes */
|
||||||
|
gl_shaded_color((unsigned char *)wcol->inner, -50);
|
||||||
|
glBegin(GL_LINES);
|
||||||
|
glVertex2f(rect->xmin, rect->ymin + zoomy * (-offsy));
|
||||||
|
glVertex2f(rect->xmax, rect->ymin + zoomy * (-offsy));
|
||||||
|
glVertex2f(rect->xmin + zoomx * (-offsx), rect->ymin);
|
||||||
|
glVertex2f(rect->xmin + zoomx * (-offsx), rect->ymax);
|
||||||
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* cfra option */
|
/* cfra option */
|
||||||
/* XXX 2.48 */
|
/* XXX 2.48 */
|
||||||
#if 0
|
#if 0
|
||||||
|
Reference in New Issue
Block a user