diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-09-28 21:07:20 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-09-28 21:07:20 +0300 |
commit | 19955ef88ef8be8fc47d4d0d840c197fdc719259 (patch) | |
tree | 953198f52040061e44152348df3dedd216e01698 /source/blender/editors/gpencil/gpencil_fill.c | |
parent | 36096fe4803afe004630bf54b81bfebc3f62621b (diff) |
GPencil: Extend Fill lines when visual aids are disabled
When the visual aids are disabled, but the extend factor
is > 0, the lines must be extended, but not displayed.
Also, some variables renamed to clarify.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_fill.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_fill.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index b505d5c27a4..5d2c4dda617 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -2792,8 +2792,9 @@ static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event) const bool is_inverted = (is_brush_inv && (event->modifier & KM_CTRL) == 0) || (!is_brush_inv && (event->modifier & KM_CTRL) != 0); const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(tgpf->gpd); - const bool do_extend = (tgpf->flag & GP_BRUSH_FILL_SHOW_EXTENDLINES); - const bool help_lines = ((tgpf->flag & GP_BRUSH_FILL_SHOW_HELPLINES) || (do_extend)); + const bool extend_lines = (tgpf->fill_extend_fac > 0.0f); + const bool show_extend = (tgpf->flag & GP_BRUSH_FILL_SHOW_EXTENDLINES); + const bool help_lines = ((tgpf->flag & GP_BRUSH_FILL_SHOW_HELPLINES) || (show_extend)); int estate = OPERATOR_RUNNING_MODAL; switch (event->type) { @@ -2862,7 +2863,7 @@ static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event) int step = ((float)i / (float)total) * 100.0f; WM_cursor_time(win, step); - if (do_extend) { + if (extend_lines) { gpencil_update_extend(tgpf); } @@ -2893,7 +2894,7 @@ static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event) loop_limit++; } - if (do_extend) { + if (extend_lines) { gpencil_delete_temp_stroke_extension(tgpf, true); } @@ -2922,13 +2923,13 @@ static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event) estate = OPERATOR_CANCELLED; } } - else if (do_extend) { + else if (extend_lines) { gpencil_update_extend(tgpf); } tgpf->oldkey = event->type; break; case EVT_SKEY: - if ((do_extend) && (event->val == KM_PRESS)) { + if ((show_extend) && (event->val == KM_PRESS)) { /* Clean temp strokes. */ stroke_array_free(tgpf); @@ -2944,7 +2945,7 @@ static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event) } break; case EVT_DKEY: - if ((do_extend) && (event->val == KM_PRESS)) { + if ((show_extend) && (event->val == KM_PRESS)) { tgpf->flag ^= GP_BRUSH_FILL_STROKE_COLLIDE; /* Clean temp strokes. */ stroke_array_free(tgpf); |