fix for crash with recent color commits to draw-object, this case wasnt handled corre...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 7 Jun 2012 15:20:51 +0000 (15:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 7 Jun 2012 15:20:51 +0000 (15:20 +0000)
source/blender/editors/space_view3d/drawobject.c

index 2c59e2861e57a6f9a991ab3f6b88c16905ddd969..edb40adfc6797e06b2cf8cd771e2cb29cb6337e4 100644 (file)
@@ -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;
        }