diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-11-02 13:13:44 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-11-02 13:13:44 +0300 |
commit | 1c8d76772a84cb616c498ffbaf0a262086b0f8fa (patch) | |
tree | fd35e9714ade246a37be6a64f9357cb8a14a646c | |
parent | 782f36d6a87eb622f6052be8ce49c380a6c78e84 (diff) |
GPencil: Fix unreported visual problem for short strokes
When the stroke has less than 3 points, but only the fill material is enabled, the stroke is invisible and makes the shaders to remove any fill because the shader start and end pointers are not correct.
Now, if the stroke has only fill, but it is not fillable, it is drawn with the stroke color to avoid the errors and these ghost strokes.
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_draw_utils.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index bbbf85c0ace..f86881a2a94 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -1265,9 +1265,11 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, gpencil_add_fill_vertexdata( cache, ob, gpl, gpf, gps, opacity, tintcolor, false, custonion); } - /* stroke */ - /* No fill strokes, must show stroke always */ - if (((gp_style->flag & GP_STYLE_STROKE_SHOW) || (gps->flag & GP_STROKE_NOFILL)) && + /* stroke + * No fill strokes, must show stroke always or if the total points is lower than 3, + * because the stroke cannot be filled and it would be invisible. */ + if (((gp_style->flag & GP_STYLE_STROKE_SHOW) || (gps->flag & GP_STROKE_NOFILL) || + (gps->totpoints < 3)) && ((gp_style->stroke_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) || (gpl->blend_mode == eGplBlendMode_Regular))) { /* recalc strokes uv (geometry can be changed by modifiers) */ |