bugfix [#22390] Lamp drawing circle bug
authorCampbell Barton <ideasman42@gmail.com>
Sat, 22 May 2010 11:58:21 +0000 (11:58 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 22 May 2010 11:58:21 +0000 (11:58 +0000)
was drawing the circle when out of view.

source/blender/editors/space_view3d/drawobject.c

index 7c0ccfa770c5a5d3e7e58f4d7a7668891b79aced..a33af5eb062343ce5715cce0a5f62fb170167086 100644 (file)
@@ -988,21 +988,23 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
                        
                /* Outer circle */
                circrad = 3.0f*lampsize;
+               setlinestyle(3);
+
                drawcircball(GL_LINE_LOOP, vec, circrad, imat);
-       }
-       else
-               circrad = 0.0f;
-       
-       setlinestyle(3);
 
-       /* draw dashed outer circle if shadow is on. remember some lamps can't have certain shadows! */
-       if (la->type!=LA_HEMI) {
-               if ((la->mode & LA_SHAD_RAY) ||
-                       ((la->mode & LA_SHAD_BUF) && (la->type==LA_SPOT)) )
-               {
-                       drawcircball(GL_LINE_LOOP, vec, circrad + 3.0f*pixsize, imat);
+               /* draw dashed outer circle if shadow is on. remember some lamps can't have certain shadows! */
+               if(la->type!=LA_HEMI) {
+                       if(     (la->mode & LA_SHAD_RAY) ||
+                               ((la->mode & LA_SHAD_BUF) && (la->type==LA_SPOT))
+                       ) {
+                               drawcircball(GL_LINE_LOOP, vec, circrad + 3.0f*pixsize, imat);
+                       }
                }
        }
+       else {
+               setlinestyle(3);
+               circrad = 0.0f;
+       }
        
        /* draw the pretty sun rays */
        if(la->type==LA_SUN) {