From 742171f60943e78f148fe6be15e4eaaf0c5f85ec Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 7 Jun 2012 15:20:51 +0000 Subject: fix for crash with recent color commits to draw-object, this case wasnt handled correctly before. --- source/blender/editors/space_view3d/drawobject.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 2c59e2861e5..edb40adfc67 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -1774,9 +1774,16 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base #ifdef VIEW3D_CAMERA_BORDER_HACK if (is_view && !(G.f & G_PICKSEL)) { - view3d_camera_border_hack_col[0] = ob_wire_col[0]; - view3d_camera_border_hack_col[1] = ob_wire_col[1]; - view3d_camera_border_hack_col[2] = ob_wire_col[2]; + if ((flag & DRAW_CONSTCOLOR) == 0) { + view3d_camera_border_hack_col[0] = ob_wire_col[0]; + view3d_camera_border_hack_col[1] = ob_wire_col[1]; + view3d_camera_border_hack_col[2] = ob_wire_col[2]; + } + else { + float col[4]; + glGetFloatv(GL_CURRENT_COLOR, col); + rgb_float_to_uchar(view3d_camera_border_hack_col, col); + } view3d_camera_border_hack_test = TRUE; return; } -- cgit v1.2.3