hue correct node: draw hsv backdrop with full alpha.

This commit is contained in:
Campbell Barton
2012-06-21 15:03:30 +00:00
parent 84c0aee254
commit 038e5b2255

View File

@@ -1363,6 +1363,24 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
offsy = cumap->curr.ymin - but->aspect / zoomy;
/* backdrop */
if (but->a1 == UI_GRAD_H) {
/* magic trigger for curve backgrounds */
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);
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 {
if (cumap->flag & CUMA_DO_CLIP) {
gl_shaded_color((unsigned char *)wcol->inner, -20);
glRectf(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
@@ -1391,24 +1409,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
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);
}
}
/* cfra option */
/* XXX 2.48 */