diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-01-20 20:46:06 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-01-20 20:46:06 +0300 |
commit | 475d536f720df3ed9bed783e6d108fa1341fe541 (patch) | |
tree | b0d4882422096ffd040d3b0fd30a100c841b29e2 /source/blender/editors/gpencil/drawgpencil.c | |
parent | a97ec403c28dc330b37459b1c94944ffe086abbb (diff) |
Fix minor glitches in GP code.
Reported by coverity scan.
Diffstat (limited to 'source/blender/editors/gpencil/drawgpencil.c')
-rw-r--r-- | source/blender/editors/gpencil/drawgpencil.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 2fd574d6523..a542bf8fa11 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -1563,7 +1563,7 @@ static void gp_draw_data_all(Scene *scene, bGPdata *gpd, int offsx, int offsy, i { bGPdata *gpd_source = NULL; ToolSettings *ts; - bGPDbrush *brush; + bGPDbrush *brush = NULL; if (scene) { ts = scene->toolsettings; brush = BKE_gpencil_brush_getactive(ts); @@ -1572,8 +1572,7 @@ static void gp_draw_data_all(Scene *scene, bGPdata *gpd, int offsx, int offsy, i BKE_gpencil_brush_init_presets(ts); brush = BKE_gpencil_brush_getactive(ts); } - } - if (scene) { + if (spacetype == SPACE_VIEW3D) { gpd_source = (scene->gpd ? scene->gpd : NULL); } @@ -1581,13 +1580,12 @@ static void gp_draw_data_all(Scene *scene, bGPdata *gpd, int offsx, int offsy, i /* currently drawing only gpencil data from either clip or track, but not both - XXX fix logic behind */ gpd_source = (scene->clip->gpd ? scene->clip->gpd : NULL); } - + if (gpd_source) { if (brush != NULL) { gp_draw_data(brush, ts->gp_sculpt.alpha, gpd_source, offsx, offsy, winx, winy, cfra, dflag); } - } } |