Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_gizmo_ruler.c
| Show First 20 Lines • Show All 778 Lines • ▼ Show 20 Lines | #define ARC_STEPS 24 | ||||
| GPU_matrix_pop(); | GPU_matrix_pop(); | ||||
| GPU_matrix_pop_projection(); | GPU_matrix_pop_projection(); | ||||
| const uint shdr_pos_2d = GPU_vertformat_attr_add( | const uint shdr_pos_2d = GPU_vertformat_attr_add( | ||||
| immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| if (ruler_item->flag & RULERITEM_USE_ANGLE) { | if (ruler_item->flag & RULERITEM_USE_ANGLE) { | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| /* capping */ | /* capping */ | ||||
| { | { | ||||
| float rot_90_vec_a[2]; | float rot_90_vec_a[2]; | ||||
| float rot_90_vec_b[2]; | float rot_90_vec_b[2]; | ||||
| float cap[2]; | float cap[2]; | ||||
| sub_v2_v2v2(dir_ruler, co_ss[0], co_ss[1]); | sub_v2_v2v2(dir_ruler, co_ss[0], co_ss[1]); | ||||
| rot_90_vec_a[0] = -dir_ruler[1]; | rot_90_vec_a[0] = -dir_ruler[1]; | ||||
| ▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | if (ruler_item->flag & RULERITEM_USE_ANGLE) { | ||||
| if (proj_ok[1]) { | if (proj_ok[1]) { | ||||
| BLF_color3ubv(blf_mono_font, color_text); | BLF_color3ubv(blf_mono_font, color_text); | ||||
| BLF_position(blf_mono_font, posit[0], posit[1], 0.0f); | BLF_position(blf_mono_font, posit[0], posit[1], 0.0f); | ||||
| BLF_rotation(blf_mono_font, 0.0f); | BLF_rotation(blf_mono_font, 0.0f); | ||||
| BLF_draw(blf_mono_font, numstr, sizeof(numstr)); | BLF_draw(blf_mono_font, numstr, sizeof(numstr)); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| sub_v2_v2v2(dir_ruler, co_ss[0], co_ss[2]); | sub_v2_v2v2(dir_ruler, co_ss[0], co_ss[2]); | ||||
| /* capping */ | /* capping */ | ||||
| { | { | ||||
| float rot_90_vec[2] = {-dir_ruler[1], dir_ruler[0]}; | float rot_90_vec[2] = {-dir_ruler[1], dir_ruler[0]}; | ||||
| float cap[2]; | float cap[2]; | ||||
| ▲ Show 20 Lines • Show All 528 Lines • Show Last 20 Lines | |||||