diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-22 02:19:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-22 12:48:16 +0300 |
commit | 620b960d3d8cfd90b9f0df6ba3671c33eccb8309 (patch) | |
tree | 64f69db4bf9d44f0a32d1c92b0714bf2dc98ff2d /source/blender/editors/gpencil/drawgpencil.c | |
parent | bba60bb564cf5a16cfcac744d4ba82cf8eba3da9 (diff) |
Cleanup: style, use braces for editors
Diffstat (limited to 'source/blender/editors/gpencil/drawgpencil.c')
-rw-r--r-- | source/blender/editors/gpencil/drawgpencil.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 47f6e2e5a6e..c54598fd549 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -325,8 +325,9 @@ static void gp_triangulate_stroke_fill(bGPDstroke *gps) } else { /* No triangles needed - Free anything allocated previously */ - if (gps->triangles) + if (gps->triangles) { MEM_freeN(gps->triangles); + } gps->triangles = NULL; } @@ -818,26 +819,33 @@ static bool gp_can_draw_stroke(const bGPDstroke *gps, const int dflag) { /* skip stroke if it isn't in the right display space for this drawing context */ /* 1) 3D Strokes */ - if ((dflag & GP_DRAWDATA_ONLY3D) && !(gps->flag & GP_STROKE_3DSPACE)) + if ((dflag & GP_DRAWDATA_ONLY3D) && !(gps->flag & GP_STROKE_3DSPACE)) { return false; - if (!(dflag & GP_DRAWDATA_ONLY3D) && (gps->flag & GP_STROKE_3DSPACE)) + } + if (!(dflag & GP_DRAWDATA_ONLY3D) && (gps->flag & GP_STROKE_3DSPACE)) { return false; + } /* 2) Screen Space 2D Strokes */ - if ((dflag & GP_DRAWDATA_ONLYV2D) && !(gps->flag & GP_STROKE_2DSPACE)) + if ((dflag & GP_DRAWDATA_ONLYV2D) && !(gps->flag & GP_STROKE_2DSPACE)) { return false; - if (!(dflag & GP_DRAWDATA_ONLYV2D) && (gps->flag & GP_STROKE_2DSPACE)) + } + if (!(dflag & GP_DRAWDATA_ONLYV2D) && (gps->flag & GP_STROKE_2DSPACE)) { return false; + } /* 3) Image Space (2D) */ - if ((dflag & GP_DRAWDATA_ONLYI2D) && !(gps->flag & GP_STROKE_2DIMAGE)) + if ((dflag & GP_DRAWDATA_ONLYI2D) && !(gps->flag & GP_STROKE_2DIMAGE)) { return false; - if (!(dflag & GP_DRAWDATA_ONLYI2D) && (gps->flag & GP_STROKE_2DIMAGE)) + } + if (!(dflag & GP_DRAWDATA_ONLYI2D) && (gps->flag & GP_STROKE_2DIMAGE)) { return false; + } /* skip stroke if it doesn't have any valid data */ - if ((gps->points == NULL) || (gps->totpoints < 1)) + if ((gps->points == NULL) || (gps->totpoints < 1)) { return false; + } /* stroke can be drawn */ return true; @@ -1143,8 +1151,9 @@ static void UNUSED_FUNCTION(gp_draw_status_text)(const bGPdata *gpd, ARegion *ar rcti rect; /* Cannot draw any status text when drawing OpenGL Renders */ - if (G.f & G_FLAG_RENDER_VIEWPORT) + if (G.f & G_FLAG_RENDER_VIEWPORT) { return; + } /* Get bounds of region - Necessary to avoid problems with region overlap */ ED_region_visible_rect(ar, &rect); |