diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-09-24 20:48:08 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-09-25 23:51:54 +0300 |
commit | 7cc9998809359dead38bd20de851494e11ab3da1 (patch) | |
tree | d671f0d08ba5d520106a17830c9790a8ec303a25 /source/blender/draw/intern/draw_manager_text.c | |
parent | 75eb947275ca86c975e3aca35772d46150188521 (diff) |
Edit Mesh: Center text when Edge length & Edge Angle is activated
This is more readable as the informations will never overlap and be off the
center of the edge.
Diffstat (limited to 'source/blender/draw/intern/draw_manager_text.c')
-rw-r--r-- | source/blender/draw/intern/draw_manager_text.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/draw/intern/draw_manager_text.c b/source/blender/draw/intern/draw_manager_text.c index b32853959c8..1a183e14d60 100644 --- a/source/blender/draw/intern/draw_manager_text.c +++ b/source/blender/draw/intern/draw_manager_text.c @@ -50,7 +50,7 @@ typedef struct ViewCachedString { int pack; } col; short sco[2]; - short xoffs; + short xoffs, yoffs; short flag; int str_len; @@ -78,7 +78,7 @@ void DRW_text_cache_add( DRWTextStore *dt, const float co[3], const char *str, const int str_len, - short xoffs, short flag, + short xoffs, short yoffs, short flag, const uchar col[4]) { int alloc_len; @@ -99,6 +99,7 @@ void DRW_text_cache_add( copy_v3_v3(vos->vec, co); copy_v4_v4_uchar(vos->col.ub, col); vos->xoffs = xoffs; + vos->yoffs = yoffs; vos->flag = flag; vos->str_len = str_len; @@ -162,7 +163,7 @@ void DRW_text_cache_draw(DRWTextStore *dt, ARegion *ar) BLF_position( font_id, - (float)(vos->sco[0] + vos->xoffs), (float)(vos->sco[1]), 2.0f); + (float)(vos->sco[0] + vos->xoffs), (float)(vos->sco[1] + vos->yoffs), 2.0f); ((vos->flag & DRW_TEXT_CACHE_ASCII) ? BLF_draw_ascii : |