diff options
author | Antonioya <blendergit@gmail.com> | 2019-03-16 22:05:15 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-03-16 22:05:15 +0300 |
commit | ad390f514bfa33abadfd09e8fd673a0cfee68b39 (patch) | |
tree | 758fba190d0169614d3297ef67e3d2a7bb2bab46 /source/blender/editors/gpencil/gpencil_add_stroke.c | |
parent | 2d3fbadfe36d67596ffe04897c13ac88c1cd9ba6 (diff) |
GPencil: Fix compiler warning
The fill flag was wrong and it was checking the color, not a flag.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_add_stroke.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_add_stroke.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/editors/gpencil/gpencil_add_stroke.c b/source/blender/editors/gpencil/gpencil_add_stroke.c index d8db3cda98d..8b261bf798b 100644 --- a/source/blender/editors/gpencil/gpencil_add_stroke.c +++ b/source/blender/editors/gpencil/gpencil_add_stroke.c @@ -48,7 +48,8 @@ typedef struct ColorTemplate { } ColorTemplate; /* Add color an ensure duplications (matched by name) */ -static int gp_stroke_material(Main *bmain, Object *ob, const ColorTemplate *pct) +static int gp_stroke_material( + Main *bmain, Object *ob, const ColorTemplate *pct, const bool fill) { short *totcol = give_totcolp(ob); Material *ma = NULL; @@ -68,7 +69,7 @@ static int gp_stroke_material(Main *bmain, Object *ob, const ColorTemplate *pct) copy_v4_v4(ma->gp_style->stroke_rgba, pct->line); copy_v4_v4(ma->gp_style->fill_rgba, pct->fill); - if (pct->fill) { + if (fill) { ma->gp_style->flag |= GP_STYLE_FILL_SHOW; } @@ -221,12 +222,12 @@ void ED_gpencil_create_stroke(bContext *C, Object *ob, float mat[4][4]) bGPDstroke *gps; /* create colors */ - int color_black = gp_stroke_material(bmain, ob, &gp_stroke_material_black); - gp_stroke_material(bmain, ob, &gp_stroke_material_white); - gp_stroke_material(bmain, ob, &gp_stroke_material_red); - gp_stroke_material(bmain, ob, &gp_stroke_material_green); - gp_stroke_material(bmain, ob, &gp_stroke_material_blue); - gp_stroke_material(bmain, ob, &gp_stroke_material_grey); + int color_black = gp_stroke_material(bmain, ob, &gp_stroke_material_black, false); + gp_stroke_material(bmain, ob, &gp_stroke_material_white, false); + gp_stroke_material(bmain, ob, &gp_stroke_material_red, false); + gp_stroke_material(bmain, ob, &gp_stroke_material_green, false); + gp_stroke_material(bmain, ob, &gp_stroke_material_blue, false); + gp_stroke_material(bmain, ob, &gp_stroke_material_grey, true); /* set first color as active and in brushes */ ob->actcol = color_black + 1; |