Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_draw.cc
| Show First 20 Lines • Show All 2,979 Lines • ▼ Show 20 Lines | if (num_elements < 100) { | ||||
| num_digits = num_elements < 10 ? 1 : 2; | num_digits = num_elements < 10 ? 1 : 2; | ||||
| } | } | ||||
| UI_fontstyle_draw_simple(&fstyle_small, | UI_fontstyle_draw_simple(&fstyle_small, | ||||
| (offset_x + ufac + UI_UNIT_X * (2 - num_digits) * 0.12f), | (offset_x + ufac + UI_UNIT_X * (2 - num_digits) * 0.12f), | ||||
| float(ys) - UI_UNIT_Y * 0.095f + ufac, | float(ys) - UI_UNIT_Y * 0.095f + ufac, | ||||
| number_text, | number_text, | ||||
| text_col); | text_col); | ||||
| UI_fontstyle_set(fstyle); | UI_fontstyle_set(fstyle); | ||||
| GPU_blend(GPU_BLEND_ALPHA); /* Roundbox and text drawing disables. */ | GPU_blend(GPU_BLEND_ALPHA); /* Round-box and text drawing disables. */ | ||||
| } | } | ||||
| static void outliner_icon_background_colors(float icon_color[4], float icon_border[4]) | static void outliner_icon_background_colors(float icon_color[4], float icon_border[4]) | ||||
| { | { | ||||
| float text[4]; | float text[4]; | ||||
| UI_GetThemeColor4fv(TH_TEXT, text); | UI_GetThemeColor4fv(TH_TEXT, text); | ||||
| copy_v3_v3(icon_color, text); | copy_v3_v3(icon_color, text); | ||||
| Show All 13 Lines | static void outliner_draw_active_indicator(const float minx, | ||||
| const float ufac = UI_UNIT_X / 20.0f; | const float ufac = UI_UNIT_X / 20.0f; | ||||
| const float radius = UI_UNIT_Y / 4.0f; | const float radius = UI_UNIT_Y / 4.0f; | ||||
| rctf rect{}; | rctf rect{}; | ||||
| BLI_rctf_init(&rect, minx, maxx, miny + ufac, maxy - ufac); | BLI_rctf_init(&rect, minx, maxx, miny + ufac, maxy - ufac); | ||||
| UI_draw_roundbox_corner_set(UI_CNR_ALL); | UI_draw_roundbox_corner_set(UI_CNR_ALL); | ||||
| UI_draw_roundbox_aa(&rect, true, radius, icon_color); | UI_draw_roundbox_aa(&rect, true, radius, icon_color); | ||||
| UI_draw_roundbox_aa(&rect, false, radius, icon_border); | UI_draw_roundbox_aa(&rect, false, radius, icon_border); | ||||
| GPU_blend(GPU_BLEND_ALPHA); /* Roundbox disables. */ | GPU_blend(GPU_BLEND_ALPHA); /* Round-box disables. */ | ||||
| } | } | ||||
| static void outliner_draw_iconrow_doit(uiBlock *block, | static void outliner_draw_iconrow_doit(uiBlock *block, | ||||
| TreeElement *te, | TreeElement *te, | ||||
| const uiFontStyle *fstyle, | const uiFontStyle *fstyle, | ||||
| int xmax, | int xmax, | ||||
| int *offsx, | int *offsx, | ||||
| int ys, | int ys, | ||||
| ▲ Show 20 Lines • Show All 573 Lines • ▼ Show 20 Lines | if (TSELEM_OPEN(tselem, space_outliner)) { | ||||
| outliner_draw_struct_marks(region, space_outliner, &te->subtree, starty); | outliner_draw_struct_marks(region, space_outliner, &te->subtree, starty); | ||||
| if (tselem->type == TSE_RNA_STRUCT) { | if (tselem->type == TSE_RNA_STRUCT) { | ||||
| GPUVertFormat *format = immVertexFormat(); | GPUVertFormat *format = immVertexFormat(); | ||||
| uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immThemeColorShadeAlpha(TH_BACK, -15, -200); | immThemeColorShadeAlpha(TH_BACK, -15, -200); | ||||
| immBegin(GPU_PRIM_LINES, 2); | immBegin(GPU_PRIM_LINES, 2); | ||||
| immVertex2f(pos, 0, (float)*starty + UI_UNIT_Y); | immVertex2f(pos, 0, float(*starty) + UI_UNIT_Y); | ||||
| immVertex2f(pos, region->v2d.cur.xmax, (float)*starty + UI_UNIT_Y); | immVertex2f(pos, region->v2d.cur.xmax, float(*starty) + UI_UNIT_Y); | ||||
| immEnd(); | immEnd(); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 386 Lines • Show Last 20 Lines | |||||