diff options
author | Charlie Jolly <mistajolly@gmail.com> | 2019-04-29 15:20:25 +0300 |
---|---|---|
committer | Charlie Jolly <mistajolly@gmail.com> | 2019-04-29 15:20:25 +0300 |
commit | d055b48e315264e4795ca936622db456b15408e0 (patch) | |
tree | 0f61fb173df62b577fb7e7a3d745277961fc04bb /source/blender/editors | |
parent | f9ee08610ac5f66441ddc972f403ca28c7d943d0 (diff) |
Fix T63592: Grease pencil - Guides still active in Fill mode
Enable guides only for Draw tool.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 6139c1caada..21ddfc3cd13 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -2717,6 +2717,8 @@ static void gpencil_draw_apply_event( PointerRNA itemptr; float mousef[2]; int tablet = 0; + bool is_speed_guide = ((guide->use_guide) && + (p->brush && (p->brush->gpencil_tool == GPAINT_TOOL_DRAW))); /* convert from window-space to area-space mouse coordinates * add any x,y override position for fake events @@ -2726,7 +2728,7 @@ static void gpencil_draw_apply_event( p->shift = event->shift; /* verify direction for straight lines */ - if ((guide->use_guide) || + if ((is_speed_guide) || ((event->alt > 0) && (RNA_boolean_get(op->ptr, "disable_straight") == false))) { if (p->straight == 0) { int dx = (int)fabsf(p->mval[0] - p->mvali[0]); @@ -2824,7 +2826,7 @@ static void gpencil_draw_apply_event( /* special exception for grid snapping * it requires direction which needs at least two points */ - if (!ELEM(p->paintmode, GP_PAINTMODE_ERASER, GP_PAINTMODE_SET_CP) && guide->use_guide && + if (!ELEM(p->paintmode, GP_PAINTMODE_ERASER, GP_PAINTMODE_SET_CP) && is_speed_guide && guide->use_snapping && (guide->type == GP_GUIDE_GRID)) { p->flags |= GP_PAINTFLAG_REQ_VECTOR; } @@ -2852,9 +2854,9 @@ static void gpencil_draw_apply_event( } /* check if stroke is straight or guided */ - if ((p->paintmode != GP_PAINTMODE_ERASER) && ((p->straight) || (guide->use_guide))) { + if ((p->paintmode != GP_PAINTMODE_ERASER) && ((p->straight) || (is_speed_guide))) { /* guided stroke */ - if (guide->use_guide) { + if (is_speed_guide) { switch (guide->type) { default: case GP_GUIDE_CIRCULAR: { |