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/view3d_draw.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/view3d_draw.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 6bf87e1964b..35ea3f10d48 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -249,7 +249,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** RegionView3D *rv3d= ar->regiondata; float wx, wy, x, y, fw, fx, fy, dx; float vec4[4]; - char col[3], col2[3]; + unsigned char col[3], col2[3]; vec4[0]=vec4[1]=vec4[2]=0.0; vec4[3]= 1.0; @@ -398,16 +398,16 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** /* center cross */ if( ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT)) - UI_make_axis_color(col, col2, 'y'); - else UI_make_axis_color(col, col2, 'x'); - glColor3ubv((GLubyte *)col2); + UI_make_axis_color(col, col2, 'Y'); + else UI_make_axis_color(col, col2, 'Z'); + glColor3ubv(col2); fdrawline(0.0, y, (float)ar->winx, y); if( ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM)) - UI_make_axis_color(col, col2, 'y'); - else UI_make_axis_color(col, col2, 'z'); - glColor3ubv((GLubyte *)col2); + UI_make_axis_color(col, col2, 'Y'); + else UI_make_axis_color(col, col2, 'Z'); + glColor3ubv(col2); fdrawline(x, 0.0, x, (float)ar->winy); @@ -419,7 +419,7 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) { float vert[3], grid, grid_scale; int a, gridlines, emphasise; - char col[3], col2[3]; + unsigned char col[3], col2[3]; short draw_line = 0; vert[2]= 0.0; @@ -462,8 +462,8 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) if(a==0) { /* check for the 'show Y axis' preference */ if (v3d->gridflag & V3D_SHOW_Y) { - UI_make_axis_color(col, col2, 'y'); - glColor3ubv((GLubyte *)col2); + UI_make_axis_color(col, col2, 'Y'); + glColor3ubv(col2); draw_line = 1; } else if (v3d->gridflag & V3D_SHOW_FLOOR) { @@ -501,8 +501,8 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) if(a==0) { /* check for the 'show X axis' preference */ if (v3d->gridflag & V3D_SHOW_X) { - UI_make_axis_color(col, col2, 'x'); - glColor3ubv((GLubyte *)col2); + UI_make_axis_color(col, col2, 'X'); + glColor3ubv(col2); draw_line = 1; } else if (v3d->gridflag & V3D_SHOW_FLOOR) { @@ -538,8 +538,8 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) /* draw the Z axis line */ /* check for the 'show Z axis' preference */ if (v3d->gridflag & V3D_SHOW_Z) { - UI_make_axis_color(col, col2, 'z'); - glColor3ubv((GLubyte *)col2); + UI_make_axis_color(col, col2, 'Z'); + glColor3ubv(col2); glBegin(GL_LINE_STRIP); vert[0]= 0; |