Fix T60944: Add Tablet eraser support to annotations usin pen
authorAntonioya <blendergit@gmail.com>
Mon, 28 Jan 2019 16:46:11 +0000 (17:46 +0100)
committerAntonioya <blendergit@gmail.com>
Mon, 28 Jan 2019 16:46:11 +0000 (17:46 +0100)
source/blender/editors/gpencil/annotate_paint.c

index d0c95af..2ec9b1a 100644 (file)
@@ -1911,6 +1911,11 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event
        Scene *scene = CTX_data_scene(C);
        tGPsdata *p = NULL;
 
+       /* support for tablets eraser pen */
+       if (gpencil_is_tablet_eraser_active(event)) {
+               RNA_enum_set(op->ptr, "mode", GP_PAINTMODE_ERASER);
+       }
+
        /* if try to do annotations with a gp object selected, first
         * unselect the object to avoid conflicts.
         * The solution is not perfect but we can keep running the annotations while