Fix T47534: Crash w/ project-paint from Python

This commit is contained in:
Campbell Barton
2016-02-23 23:47:30 +11:00
parent 56da420112
commit 6ac0d357d6

View File

@@ -1237,15 +1237,16 @@ int paint_stroke_exec(bContext *C, wmOperator *op)
{
PaintStroke *stroke = op->customdata;
/* only when executed for the first time */
if (stroke->stroke_started == 0) {
/* XXX stroke->last_mouse_position is unset, this may cause problems */
stroke->test_start(C, op, NULL);
stroke->stroke_started = 1;
}
RNA_BEGIN (op->ptr, itemptr, "stroke")
{
/* only when executed for the first time */
if (stroke->stroke_started == 0) {
float mval[2];
RNA_float_get_array(&itemptr, "mouse", mval);
stroke->test_start(C, op, mval);
stroke->stroke_started = 1;
}
stroke->update_step(C, stroke, &itemptr);
}
RNA_END;