From 4cdf4d1ebaeded7a79905e69814a77ec16b5078d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 5 Nov 2018 11:04:32 +1100 Subject: Cleanup: correct last commit, also use font_id var --- .../editors/space_view3d/view3d_gizmo_navigate_type.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c') 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(); } -- cgit v1.2.3