Fix T68021: GPencil After using eraser when draw primitives, next primitive has missing handles

The problem was related to wrong Brush. After using the Eraser or Fill, the default brush was not the drawing one, so the handles were missing.

Now, the operator force the drawing brush.

Reviewer: @campbellbarton
Differential Revision: http://developer.blender.org/D5403
This commit is contained in:
Antonio Vazquez 2019-08-02 16:24:24 +02:00
parent 9198ff4306
commit 455a1e210b

@ -1127,7 +1127,12 @@ static void gpencil_primitive_init(bContext *C, wmOperator *op)
if ((paint->brush == NULL) || (paint->brush->gpencil_settings == NULL)) {
BKE_brush_gpencil_presets(C);
}
tgpi->brush = paint->brush;
/* Set Draw brush. */
Brush *brush = BKE_paint_toolslots_brush_get(paint, 0);
BKE_brush_tool_set(brush, paint, 0);
BKE_paint_brush_set(paint, brush);
tgpi->brush = brush;
/* control points */
tgpi->gpd->runtime.cp_points = MEM_callocN(sizeof(bGPDcontrolpoint) * MAX_CP,