grease pencil xray option wasn't being applied to single points in the 3d view.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 26 Mar 2013 07:41:59 +0000 (07:41 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 26 Mar 2013 07:41:59 +0000 (07:41 +0000)
source/blender/editors/gpencil/drawgpencil.c

index 59850aff72fc7167eddf6d535dbda7601d498fd6..fae3416e00a65b600195ac038e4966aca6905224 100644 (file)
@@ -499,9 +499,7 @@ static void gp_draw_strokes(bGPDframe *gpf, int offsx, int offsy, int winx, int
                        continue;
                
                /* check which stroke-drawer to use */
-               if (gps->totpoints == 1)
-                       gp_draw_stroke_point(gps->points, lthick, dflag, gps->flag, offsx, offsy, winx, winy);
-               else if (dflag & GP_DRAWDATA_ONLY3D) {
+               if (dflag & GP_DRAWDATA_ONLY3D) {
                        const int no_xray = (dflag & GP_DRAWDATA_NO_XRAY);
                        int mask_orig = 0;
                        
@@ -519,7 +517,12 @@ static void gp_draw_strokes(bGPDframe *gpf, int offsx, int offsy, int winx, int
 #endif
                        }
                        
-                       gp_draw_stroke_3d(gps->points, gps->totpoints, lthick, debug);
+                       if (gps->totpoints == 1) {
+                               gp_draw_stroke_point(gps->points, lthick, dflag, gps->flag, offsx, offsy, winx, winy);
+                       }
+                       else {
+                               gp_draw_stroke_3d(gps->points, gps->totpoints, lthick, debug);
+                       }
                        
                        if (no_xray) {
                                glDepthMask(mask_orig);
@@ -532,8 +535,14 @@ static void gp_draw_strokes(bGPDframe *gpf, int offsx, int offsy, int winx, int
 #endif
                        }
                }
-               else if (gps->totpoints > 1)
-                       gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, offsx, offsy, winx, winy);
+               else {
+                       if (gps->totpoints == 1) {
+                               gp_draw_stroke_point(gps->points, lthick, dflag, gps->flag, offsx, offsy, winx, winy);
+                       }
+                       else {
+                               gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, offsx, offsy, winx, winy);
+                       }
+               }
        }
 }