forked from bartvdbraak/blender
Experimental fix for "random large dots" bug when using a stylus
Since I don't have a (pressure sensitive) tablet handy, I can't really test this out, but apparently there is a bug which currently exists with the following description: "Small Dots, when you do just one click a single GP dot is created, it´s fine but don't recognize the pen pressure, always the maximum value of thickness, and It´s so easy create dots accidentally (even when you use the eraser, this dots appear spontaneously) and you start to have big screen-size-constant dots beside of you fine lines." This commit just shuffles around the order of things a bit so that some of the misfiring events might get skipped instead.
This commit is contained in:
parent
49052c61f8
commit
4ab5883766
@ -1598,15 +1598,6 @@ static void gpencil_draw_apply_event(wmOperator *op, const wmEvent *event)
|
||||
else
|
||||
p->pressure = 1.0f;
|
||||
|
||||
/* fill in stroke data (not actually used directly by gpencil_draw_apply) */
|
||||
RNA_collection_add(op->ptr, "stroke", &itemptr);
|
||||
|
||||
mousef[0] = p->mval[0];
|
||||
mousef[1] = p->mval[1];
|
||||
RNA_float_set_array(&itemptr, "mouse", mousef);
|
||||
RNA_float_set(&itemptr, "pressure", p->pressure);
|
||||
RNA_boolean_set(&itemptr, "is_start", (p->flags & GP_PAINTFLAG_FIRSTRUN));
|
||||
|
||||
/* special exception for start of strokes (i.e. maybe for just a dot) */
|
||||
if (p->flags & GP_PAINTFLAG_FIRSTRUN) {
|
||||
p->flags &= ~GP_PAINTFLAG_FIRSTRUN;
|
||||
@ -1623,6 +1614,15 @@ static void gpencil_draw_apply_event(wmOperator *op, const wmEvent *event)
|
||||
return;
|
||||
}
|
||||
|
||||
/* fill in stroke data (not actually used directly by gpencil_draw_apply) */
|
||||
RNA_collection_add(op->ptr, "stroke", &itemptr);
|
||||
|
||||
mousef[0] = p->mval[0];
|
||||
mousef[1] = p->mval[1];
|
||||
RNA_float_set_array(&itemptr, "mouse", mousef);
|
||||
RNA_float_set(&itemptr, "pressure", p->pressure);
|
||||
RNA_boolean_set(&itemptr, "is_start", (p->flags & GP_PAINTFLAG_FIRSTRUN));
|
||||
|
||||
RNA_float_set(&itemptr, "time", p->curtime - p->inittime);
|
||||
|
||||
/* apply the current latest drawing point */
|
||||
|
Loading…
Reference in New Issue
Block a user