diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-05 03:04:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-05 03:06:09 +0300 |
commit | 4cdf4d1ebaeded7a79905e69814a77ec16b5078d (patch) | |
tree | 625762feb7bf39df50bdd94d90a67834c8a22260 /source | |
parent | c192ce6717d7c1da741d80671ffcc7ea02e664c8 (diff) |
Cleanup: correct last commit, also use font_id var
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c index 5c251fe4136..94284f8439d 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c @@ -214,12 +214,14 @@ static void axis_geom_draw( #ifdef USE_AXIS_FONT struct { float matrix[4][4]; + int id; } font; { - BLF_disable(blf_mono_font, BLF_ROTATION | BLF_SHADOW | BLF_MATRIX | BLF_ASPECT | BLF_WORD_WRAP); - BLF_color4fv(blf_mono_font, axis_black); - BLF_size(blf_mono_font, 11 * U.dpi_fac, 72); + font.id = blf_mono_font; + BLF_disable(font.id, BLF_ROTATION | BLF_SHADOW | BLF_MATRIX | BLF_ASPECT | BLF_WORD_WRAP); + BLF_color4fv(font.id, axis_black); + BLF_size(font.id, 11 * U.dpi_fac, 72); /* Calculate the inverse of the (matrix_final * matrix_offset). * This allows us to use the final location, while reversing the rotation so fonts @@ -338,9 +340,9 @@ static void axis_geom_draw( const char axis_str[2] = {'X' + axis, 0}; float offset[2] = {0}; - BLF_width_and_height(blf_mono_font, axis_str, 2, &offset[0], &offset[1]); - BLF_position(blf_mono_font, roundf(offset[0] * -0.5f), roundf(offset[1] * -0.5f), 0); - BLF_draw_ascii(blf_mono_font, axis_str, 2); + BLF_width_and_height(font.id, axis_str, 2, &offset[0], &offset[1]); + BLF_position(font.id, roundf(offset[0] * -0.5f), roundf(offset[1] * -0.5f), 0); + BLF_draw_ascii(font.id, axis_str, 2); GPU_blend(true); /* XXX, blf disables */ GPU_matrix_pop(); @@ -356,10 +358,6 @@ static void axis_geom_draw( } } -#ifdef USE_AXIS_FONT - BLF_disable(blf_mono_font, BLF_MATRIX); -#endif - GPU_matrix_pop(); immUnbindProgram(); } |