diff options
author | Alessio Monti di Sopra <a.monti> | 2019-10-11 18:27:34 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-10-11 18:28:35 +0300 |
commit | ecd86c05879dc0802d7fb463d64b96559e43a4df (patch) | |
tree | 1fd6eebfb61d3d4efd5e3d04c2b3fc8738353b44 /source/blender/editors/space_view3d/view3d_draw.c | |
parent | c5ecfd526e2abe88bee5e4b2e737578a2158eea5 (diff) |
UI: Fix grid scale text not having shadows in the 3d view infos
This commit adds a shadow to the grid scale info text in the 3d View,
to make it more visible like the rest of that section.
{F7798605}
Differential Revision: https://developer.blender.org/D6025
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index aafd36a5bb8..3ee9755cb06 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1422,18 +1422,24 @@ static void draw_grid_unit_name( { if (!rv3d->is_persp && RV3D_VIEW_IS_AXIS(rv3d->view)) { const char *grid_unit = NULL; + int font_id = BLF_default(); ED_view3d_grid_view_scale(scene, v3d, rv3d, &grid_unit); if (grid_unit) { char numstr[32] = ""; - UI_FontThemeColor(BLF_default(), TH_TEXT_HI); + UI_FontThemeColor(font_id, TH_TEXT_HI); if (v3d->grid != 1.0f) { BLI_snprintf(numstr, sizeof(numstr), "%s x %.4g", grid_unit, v3d->grid); } *yoffset -= U.widget_unit; + BLF_enable(font_id, BLF_SHADOW); + BLF_shadow(font_id, 5, (const float[4]){0.0f, 0.0f, 0.0f, 1.0f}); + BLF_shadow_offset(font_id, 1, -1); BLF_draw_default_ascii( xoffset, *yoffset, 0.0f, numstr[0] ? numstr : grid_unit, sizeof(numstr)); + + BLF_disable(font_id, BLF_SHADOW); } } } |