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:
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r--source/blender/editors/interface/interface_widgets.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 9b736eb1bf4..18c6d969222 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -96,8 +96,7 @@ typedef struct uiWidgetBase {
float inner_v[WIDGET_SIZE_MAX][2];
float inner_uv[WIDGET_SIZE_MAX][2];
- short inner, outline, emboss; /* set on/off */
- short shadedir;
+ bool inner, outline, emboss, shadedir;
uiWidgetTrias tria1;
uiWidgetTrias tria2;
@@ -209,9 +208,9 @@ void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y
/* for each AA step */
for (j = 0; j < WIDGET_AA_JITTER; j++) {
- glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f);
+ glTranslatef(jit[j][0], jit[j][1], 0.0f);
glDrawArrays(GL_TRIANGLES, 0, 3);
- glTranslatef(-1.0f * jit[j][0], -1.0f * jit[j][1], 0.0f);
+ glTranslatef(-jit[j][0], -jit[j][1], 0.0f);
}
glDisableClientState(GL_VERTEX_ARRAY);
@@ -232,9 +231,9 @@ void ui_draw_anti_roundbox(int mode, float minx, float miny, float maxx, float m
glColor4fv(color);
for (j = 0; j < WIDGET_AA_JITTER; j++) {
- glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f);
+ glTranslatef(jit[j][0], jit[j][1], 0.0f);
uiDrawBox(mode, minx, miny, maxx, maxy, rad);
- glTranslatef(-1.0f * jit[j][0], -1.0f * jit[j][1], 0.0f);
+ glTranslatef(-jit[j][0], -jit[j][1], 0.0f);
}
glDisable(GL_BLEND);
@@ -778,7 +777,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
glEnableClientState(GL_VERTEX_ARRAY);
for (j = 0; j < WIDGET_AA_JITTER; j++) {
- glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f);
+ glTranslatef(jit[j][0], jit[j][1], 0.0f);
/* outline */
glColor4ubv(tcol);
@@ -794,7 +793,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
glDrawArrays(GL_QUAD_STRIP, 0, wtb->halfwayvert * 2);
}
- glTranslatef(-1.0f * jit[j][0], -1.0f * jit[j][1], 0.0f);
+ glTranslatef(-jit[j][0], -jit[j][1], 0.0f);
}
glDisableClientState(GL_VERTEX_ARRAY);
@@ -808,7 +807,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
(unsigned char)((float)wcol->item[3] / WIDGET_AA_JITTER)};
/* for each AA step */
for (j = 0; j < WIDGET_AA_JITTER; j++) {
- glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f);
+ glTranslatef(jit[j][0], jit[j][1], 0.0f);
if (wtb->tria1.tot) {
glColor4ubv(tcol);
@@ -819,7 +818,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
widget_trias_draw(&wtb->tria2);
}
- glTranslatef(-1.0f * jit[j][0], -1.0f * jit[j][1], 0.0f);
+ glTranslatef(-jit[j][0], -jit[j][1], 0.0f);
}
}
@@ -2365,7 +2364,7 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, const rcti *rect, const rcti *slid
uiWidgetBase wtb;
int horizontal;
float rad;
- short outline = 0;
+ bool outline = false;
widget_init(&wtb);
@@ -2409,8 +2408,9 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, const rcti *rect, const rcti *slid
wtb.emboss = 0; /* only emboss once */
/* exception for progress bar */
- if (state & UI_SCROLL_NO_OUTLINE)
- SWAP(short, outline, wtb.outline);
+ if (state & UI_SCROLL_NO_OUTLINE) {
+ SWAP(bool, outline, wtb.outline);
+ }
round_box_edges(&wtb, UI_CNR_ALL, slider, rad);
@@ -2431,8 +2431,9 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, const rcti *rect, const rcti *slid
}
widgetbase_draw(&wtb, wcol);
- if (state & UI_SCROLL_NO_OUTLINE)
- SWAP(short, outline, wtb.outline);
+ if (state & UI_SCROLL_NO_OUTLINE) {
+ SWAP(bool, outline, wtb.outline);
+ }
}
}