Fix regression in grease pencil drawing
authorCampbell Barton <ideasman42@gmail.com>
Fri, 8 Jun 2018 08:52:49 +0000 (10:52 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 8 Jun 2018 08:52:49 +0000 (10:52 +0200)
Drag events finished drawing early.

source/blender/editors/gpencil/gpencil_paint.c

index af140501069f2090831bd3f764616440feb460d6..ece1b74d8dd78d2b8e3e8486a4bb6a5b29c49c2b 100644 (file)
@@ -2489,7 +2489,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
         *    (Disabling RIGHTMOUSE case here results in bugs like [#32647])
         * also making sure we have a valid event value, to not exit too early
         */
-       if (ELEM(event->type, LEFTMOUSE, RIGHTMOUSE) && (event->val != KM_NOTHING)) {
+       if (ELEM(event->type, LEFTMOUSE, RIGHTMOUSE) && (ELEM(event->val, KM_PRESS, KM_RELEASE))) {
                /* if painting, end stroke */
                if (p->status == GP_STATUS_PAINTING) {
                        int sketch = 0;
@@ -2635,7 +2635,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                estate = OPERATOR_FINISHED;
                        }
                }
-               else {
+               else if (event->val == KM_RELEASE) {
                        p->status = GP_STATUS_IDLING;
                        op->flag |= OP_IS_MODAL_CURSOR_REGION;
                }