[Bf-blender-cvs] [4ab5883] master: Experimental fix for "random large dots" bug when using a stylus

Joshua Leung noreply at git.blender.org
Sat Dec 27 15:06:32 CET 2014


Commit: 4ab58837667c990baeddea2e9d722c3203743c9c
Author: Joshua Leung
Date:   Sat Dec 27 17:37:45 2014 +1300
Branches: master
https://developer.blender.org/rB4ab58837667c990baeddea2e9d722c3203743c9c

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.

===================================================================

M	source/blender/editors/gpencil/gpencil_paint.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index d4026b1..e6f6644 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -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 */




More information about the Bf-blender-cvs mailing list