use the same stippled drawing for colorband background as alpha color swatches, with low DPI would look squashed, also use the same colors for both.

This commit is contained in:
2011-06-06 09:12:03 +00:00
parent 2f5c7623b0
commit 6a1e74418c
3 changed files with 30 additions and 26 deletions

View File

@@ -159,6 +159,18 @@ static float check_tria_vert[6][2]= {
static int check_tria_face[4][3]= {
{3, 2, 4}, {3, 4, 5}, {1, 0, 3}, {0, 2, 3}};
GLubyte checker_stipple_sml[32*32/8] =
{
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
};
/* ************************************************* */
void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3)
@@ -614,22 +626,10 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
if(wtb->inner) {
if(wcol->shaded==0) {
if (wcol->alpha_check) {
GLubyte checker_stipple_sml[32*32/8] =
{
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
};
float x_mid= 0.0f; /* used for dumb clamping of values */
/* dark checkers */
glColor4ub(100, 100, 100, 255);
glColor4ub(UI_TRANSP_DARK, UI_TRANSP_DARK, UI_TRANSP_DARK, 255);
glBegin(GL_POLYGON);
for(a=0; a<wtb->totvert; a++) {
glVertex2fv(wtb->inner_v[a]);
@@ -638,7 +638,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
/* light checkers */
glEnable(GL_POLYGON_STIPPLE);
glColor4ub(160, 160, 160, 255);
glColor4ub(UI_TRANSP_LIGHT, UI_TRANSP_LIGHT, UI_TRANSP_LIGHT, 255);
glPolygonStipple(checker_stipple_sml);
glBegin(GL_POLYGON);
for(a=0; a<wtb->totvert; a++) {