Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-12-20 06:59:22 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-20 06:59:22 +0300
commit3bed4cbf2b4c09dcb62197b8a8c4ec4224abc8b7 (patch)
treefc800fc89f29db4ac9d951ff148b8424c8cb7c73 /source/blender/editors/transform/transform_manipulator.c
parent17f37dceccb99d7eb58f7c29908eeb2bd87cd7ff (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/transform/transform_manipulator.c')
-rw-r--r--source/blender/editors/transform/transform_manipulator.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index ce8a484eb88..238f53cbb87 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -695,16 +695,16 @@ static char axisBlendAngle(float angle)
moving: in transform theme color
else the red/green/blue
*/
-static void manipulator_setcolor(View3D *v3d, char axis, int colcode, char alpha)
+static void manipulator_setcolor(View3D *v3d, char axis, int colcode, unsigned char alpha)
{
- char col[4];
+ unsigned char col[4]= {0};
+ col[3]= alpha;
if(colcode==MAN_GHOST) {
- glColor4ub(0, 0, 0, 70);
+ col[3]= 70;
}
else if(colcode==MAN_MOVECOL) {
UI_GetThemeColor3ubv(TH_TRANSFORM, col);
- glColor4ub(col[0], col[1], col[2], alpha);
}
else {
switch(axis) {
@@ -720,19 +720,22 @@ static void manipulator_setcolor(View3D *v3d, char axis, int colcode, char alpha
col[1]= col[1]<55?0:col[1]-55;
col[2]= col[2]<55?0:col[2]-55;
}
- glColor4ub(col[0], col[1], col[2], alpha);
break;
case 'x':
- glColor4ub(220, 0, 0, alpha);
+ col[0]= 220;
break;
case 'y':
- glColor4ub(0, 220, 0, alpha);
+ col[1]= 220;
break;
case 'z':
- glColor4ub(30, 30, 220, alpha);
+ col[0]= 30;
+ col[1]= 30;
+ col[2]= 220;
break;
}
}
+
+ glColor4ubv(col);
}
/* viewmatrix should have been set OK, also no shademode! */