[Bf-blender-cvs] [4cdf4d1ebae] blender2.8: Cleanup: correct last commit, also use font_id var
Campbell Barton
noreply at git.blender.org
Mon Nov 5 01:06:23 CET 2018
Commit: 4cdf4d1ebaeded7a79905e69814a77ec16b5078d
Author: Campbell Barton
Date: Mon Nov 5 11:04:32 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB4cdf4d1ebaeded7a79905e69814a77ec16b5078d
Cleanup: correct last commit, also use font_id var
===================================================================
M 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();
}
More information about the Bf-blender-cvs
mailing list