3D View: respect text option for edit-mode info

This commit is contained in:
Campbell Barton 2018-06-01 09:22:08 +02:00
parent a6395cebb7
commit 5736157b5e
3 changed files with 8 additions and 3 deletions

View File

@ -1230,6 +1230,7 @@ void DRW_draw_view(const bContext *C)
/* Reset before using it. */
drw_state_prepare_clean_for_draw(&DST);
DST.options.draw_text = (v3d->overlay.flag & V3D_OVERLAY_HIDE_TEXT) != 0;
DRW_draw_render_loop_ex(depsgraph, engine_type, ar, v3d, viewport, C);
}
@ -1969,7 +1970,8 @@ bool DRW_state_show_text(void)
{
return (DST.options.is_select) == 0 &&
(DST.options.is_depth) == 0 &&
(DST.options.is_scene_render) == 0;
(DST.options.is_scene_render) == 0 &&
(DST.options.draw_text) == 0;
}
/**

View File

@ -324,6 +324,7 @@ typedef struct DRWManager {
uint is_image_render : 1;
uint is_scene_render : 1;
uint draw_background : 1;
uint draw_text : 1;
} options;
/* Current rendering context */

View File

@ -515,8 +515,10 @@ static void EDIT_MESH_cache_populate(void *vedata, Object *ob)
ME_DRAWEXTRA_EDGEANG |
ME_DRAWEXTRA_INDICES))
{
DRW_edit_mesh_mode_text_measure_stats(
draw_ctx->ar, v3d, ob, &scene->unit);
if (DRW_state_show_text()) {
DRW_edit_mesh_mode_text_measure_stats(
draw_ctx->ar, v3d, ob, &scene->unit);
}
}
}
}