Make current frame indicator smaller with rounded corners.
Reviewed by Joshua Leung
This commit is contained in:
@@ -80,6 +80,7 @@ void ANIM_draw_cfra_number(const bContext *C, View2D *v2d, short flag)
|
|||||||
Gwn_VertFormat *format = immVertexFormat();
|
Gwn_VertFormat *format = immVertexFormat();
|
||||||
unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||||
unsigned char col[4];
|
unsigned char col[4];
|
||||||
|
float color[4];
|
||||||
float xscale, x, y;
|
float xscale, x, y;
|
||||||
char numstr[32] = " t "; /* t is the character to start replacing from */
|
char numstr[32] = " t "; /* t is the character to start replacing from */
|
||||||
float hlen;
|
float hlen;
|
||||||
@@ -105,19 +106,20 @@ void ANIM_draw_cfra_number(const bContext *C, View2D *v2d, short flag)
|
|||||||
|
|
||||||
/* get starting coordinates for drawing */
|
/* get starting coordinates for drawing */
|
||||||
x = cfra * xscale;
|
x = cfra * xscale;
|
||||||
y = 0.02f * U.widget_unit;
|
y = -0.1f * U.widget_unit;
|
||||||
|
|
||||||
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
|
|
||||||
|
|
||||||
/* draw green box around/behind text */
|
/* draw green box around/behind text */
|
||||||
immUniformThemeColorShade(TH_CFRAME, 0);
|
UI_GetThemeColor4fv(TH_CFRAME, color);
|
||||||
|
color[3] = 3.0f;
|
||||||
|
|
||||||
immRectf(pos,
|
UI_draw_roundbox_corner_set(UI_CNR_ALL);
|
||||||
x - hlen - 0.20f * U.widget_unit,
|
UI_draw_roundbox_aa(true,
|
||||||
y,
|
x - hlen - 0.1f * U.widget_unit,
|
||||||
x + hlen + 0.2f * U.widget_unit,
|
y + 3.0f,
|
||||||
y + U.widget_unit);
|
x + hlen + 0.1f * U.widget_unit,
|
||||||
immUnbindProgram();
|
y -3.0f + U.widget_unit,
|
||||||
|
0.1f * U.widget_unit,
|
||||||
|
color);
|
||||||
|
|
||||||
/* draw current frame number */
|
/* draw current frame number */
|
||||||
UI_GetThemeColor4ubv(TH_TEXT_HI, col);
|
UI_GetThemeColor4ubv(TH_TEXT_HI, col);
|
||||||
|
Reference in New Issue
Block a user