Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_ruler.c
| Show First 20 Lines • Show All 543 Lines • ▼ Show 20 Lines | if (ruler_item->flag & RULERITEM_USE_ANGLE) { | ||||
| BLF_width_and_height(blf_mono_font, numstr, sizeof(numstr), &numstr_size[0], &numstr_size[1]); | BLF_width_and_height(blf_mono_font, numstr, sizeof(numstr), &numstr_size[0], &numstr_size[1]); | ||||
| pos[0] = co_ss[1][0] + (cap_size * 2.0f); | pos[0] = co_ss[1][0] + (cap_size * 2.0f); | ||||
| pos[1] = co_ss[1][1] - (numstr_size[1] / 2.0f); | pos[1] = co_ss[1][1] - (numstr_size[1] / 2.0f); | ||||
| /* draw text (bg) */ | /* draw text (bg) */ | ||||
| glColor4ubv(color_back); | glColor4ubv(color_back); | ||||
| uiSetRoundBox(UI_CNR_ALL); | UI_draw_roundbox_corner_set(UI_CNR_ALL); | ||||
| uiRoundBox(pos[0] - bg_margin, pos[1] - bg_margin, | UI_draw_roundbox( | ||||
| pos[0] - bg_margin, pos[1] - bg_margin, | |||||
| pos[0] + bg_margin + numstr_size[0], pos[1] + bg_margin + numstr_size[1], | pos[0] + bg_margin + numstr_size[0], pos[1] + bg_margin + numstr_size[1], | ||||
| bg_radius); | bg_radius); | ||||
| /* draw text */ | /* draw text */ | ||||
| glColor3ubv(color_text); | glColor3ubv(color_text); | ||||
| BLF_position(blf_mono_font, pos[0], pos[1], 0.0f); | BLF_position(blf_mono_font, pos[0], pos[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)); | ||||
| } | } | ||||
| /* capping */ | /* capping */ | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | else { | ||||
| mid_v2_v2v2(pos, co_ss[0], co_ss[2]); | mid_v2_v2v2(pos, co_ss[0], co_ss[2]); | ||||
| /* center text */ | /* center text */ | ||||
| pos[0] -= numstr_size[0] / 2.0f; | pos[0] -= numstr_size[0] / 2.0f; | ||||
| pos[1] -= numstr_size[1] / 2.0f; | pos[1] -= numstr_size[1] / 2.0f; | ||||
| /* draw text (bg) */ | /* draw text (bg) */ | ||||
| glColor4ubv(color_back); | glColor4ubv(color_back); | ||||
| uiSetRoundBox(UI_CNR_ALL); | UI_draw_roundbox_corner_set(UI_CNR_ALL); | ||||
| uiRoundBox(pos[0] - bg_margin, pos[1] - bg_margin, | UI_draw_roundbox(pos[0] - bg_margin, pos[1] - bg_margin, | ||||
| pos[0] + bg_margin + numstr_size[0], pos[1] + bg_margin + numstr_size[1], | pos[0] + bg_margin + numstr_size[0], pos[1] + bg_margin + numstr_size[1], | ||||
| bg_radius); | bg_radius); | ||||
| /* draw text */ | /* draw text */ | ||||
| glColor3ubv(color_text); | glColor3ubv(color_text); | ||||
| BLF_position(blf_mono_font, pos[0], pos[1], 0.0f); | BLF_position(blf_mono_font, pos[0], pos[1], 0.0f); | ||||
| BLF_draw(blf_mono_font, numstr, sizeof(numstr)); | BLF_draw(blf_mono_font, numstr, sizeof(numstr)); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 407 Lines • Show Last 20 Lines | |||||