diff options
author | Ton Roosendaal <ton@blender.org> | 2009-05-18 20:42:34 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-05-18 20:42:34 +0400 |
commit | 0cd511eee8039f9c0f59004329cff911693ac761 (patch) | |
tree | 9d7c0203b79db54d23412c61de97520452ba7c3a /source/blender/editors/space_view3d/drawarmature.c | |
parent | d128e1656169db09efb6cc11208cc98f5bbc54bc (diff) |
2.5
Text drawing in 3D window fixed, using BLF default font (yes, nice AA'ed
fonts too :)
Solved it by gathering all strings that needs to be drawn for an object,
and then draw in end of object drawing, in pixelspace. Also cleaned up
some of the code for projecting 3d coords, much nicer now (mat stored in
region-view3d)
Diffstat (limited to 'source/blender/editors/space_view3d/drawarmature.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawarmature.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index dfdd70b11e7..68a9bf3f555 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1805,8 +1805,7 @@ static void draw_pose_channels(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ba /* Draw names of bone */ if (arm->flag & ARM_DRAWNAMES) { VecMidf(vec, pchan->pose_head, pchan->pose_tail); - BLF_draw_default(vec[0], vec[1], vec[2], " "); - BLF_draw_default(vec[0] + BLF_width_default(" "), vec[1], vec[2], pchan->name); + view3d_object_text_draw_add(vec[0], vec[1], vec[2], pchan->name, 10); } /* Draw additional axes on the bone tail */ @@ -1991,8 +1990,7 @@ static void draw_ebones(View3D *v3d, RegionView3D *rv3d, Object *ob, int dt) if (arm->flag & ARM_DRAWNAMES) { VecMidf(vec, eBone->head, eBone->tail); glRasterPos3fv(vec); - BLF_draw_default(vec[0], vec[1], vec[2], " "); - BLF_draw_default(vec[0] + BLF_width_default(" "), vec[1], vec[2], eBone->name); + view3d_object_text_draw_add(vec[0], vec[1], vec[2], eBone->name, 10); } /* Draw additional axes */ if (arm->flag & ARM_DRAWAXES) { @@ -2154,12 +2152,12 @@ static void draw_pose_paths(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec /* only draw framenum if several consecutive highlighted points don't occur on same point */ if (a == 0) { sprintf(str, " %d\n", (a+sfra)); - BLF_draw_default(fp[0], fp[1], fp[2], str); + view3d_object_text_draw_add(fp[0], fp[1], fp[2], str, 0); } else if ((a > stepsize) && (a < len-stepsize)) { if ((VecEqual(fp, fp-(stepsize*3))==0) || (VecEqual(fp, fp+(stepsize*3))==0)) { sprintf(str, " %d\n", (a+sfra)); - BLF_draw_default(fp[0], fp[1], fp[2], str); + view3d_object_text_draw_add(fp[0], fp[1], fp[2], str, 0); } } } @@ -2202,7 +2200,7 @@ static void draw_pose_paths(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec char str[32]; sprintf(str, " %d\n", (a+sfra)); - BLF_draw_default(fp[0], fp[1], fp[2], str); + view3d_object_text_draw_add(fp[0], fp[1], fp[2], str, 0); } } } |