diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-20 06:59:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-20 06:59:22 +0300 |
commit | 3bed4cbf2b4c09dcb62197b8a8c4ec4224abc8b7 (patch) | |
tree | fc800fc89f29db4ac9d951ff148b8424c8cb7c73 /source/blender/editors/space_view3d/drawanimviz.c | |
parent | 17f37dceccb99d7eb58f7c29908eeb2bd87cd7ff (diff) |
fix [#25283] Edge length display difficult to read
- made theme colors for mesh edge len & face angle/area display.
- use %g rather then %f for float display, trims unneeded zeros.
- store cached 2d and 3d text color as bytes rather then floats, compare when drawing to avoid setting the context.
- use unsigned char for more color functions, avoids casting to glColorubv().
Diffstat (limited to 'source/blender/editors/space_view3d/drawanimviz.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawanimviz.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c index 7035006ea70..7c07f99b8ea 100644 --- a/source/blender/editors/space_view3d/drawanimviz.c +++ b/source/blender/editors/space_view3d/drawanimviz.c @@ -206,6 +206,10 @@ void draw_motion_path_instance(Scene *scene, /* Draw frame numbers at each framestep value */ if (avs->path_viewflag & MOTIONPATH_VIEW_FNUMS) { + unsigned char col[4]; + UI_GetThemeColor3ubv(TH_TEXT_HI, col); + col[3]= 255; + for (i=0, mpv=mpv_start; i < len; i+=stepsize, mpv+=stepsize) { char str[32]; float co[3]; @@ -214,7 +218,7 @@ void draw_motion_path_instance(Scene *scene, if (i == 0) { sprintf(str, "%d", (i+sfra)); mul_v3_m4v3(co, ob->imat, mpv->co); - view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII); + view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); } else if ((i > stepsize) && (i < len-stepsize)) { bMotionPathVert *mpvP = (mpv - stepsize); @@ -223,7 +227,7 @@ void draw_motion_path_instance(Scene *scene, if ((equals_v3v3(mpv->co, mpvP->co)==0) || (equals_v3v3(mpv->co, mpvN->co)==0)) { sprintf(str, "%d", (sfra+i)); mul_v3_m4v3(co, ob->imat, mpv->co); - view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII); + view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); } } } @@ -231,6 +235,8 @@ void draw_motion_path_instance(Scene *scene, /* Keyframes - dots and numbers */ if (avs->path_viewflag & MOTIONPATH_VIEW_KFRAS) { + unsigned char col[4]; + AnimData *adt= BKE_animdata_from_id(&ob->id); DLRBT_Tree keys; @@ -256,8 +262,11 @@ void draw_motion_path_instance(Scene *scene, } /* Draw slightly-larger yellow dots at each keyframe */ - UI_ThemeColor(TH_VERTEX_SELECT); + UI_GetThemeColor3ubv(TH_VERTEX_SELECT, col); + col[3]= 255; + glPointSize(4.0f); // XXX perhaps a bit too big + glColor3ubv(col); glBegin(GL_POINTS); for (i=0, mpv=mpv_start; i < len; i++, mpv++) { @@ -281,7 +290,7 @@ void draw_motion_path_instance(Scene *scene, sprintf(str, "%d", (sfra+i)); mul_v3_m4v3(co, ob->imat, mpv->co); - view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII); + view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); } } } |