StopGap Fix for T44932: Ignore pressure values when drawing straight line segments with GPencil

After some testing of the behaviour of this stuff, it became clear that the current
pressure handling here isn't very useful. The initial point would invariably get a
low pressure value (due to the way that the initial tap needs time to "take"), while
the end of the stroke suffers from similar issues (i.e. when the pen is released).
Meanwhile, the line thickness would flicker while drawing the stroke, as the endpoint
pressure varied.

So, until we find a better way, all straight line segments are now drawn without
pressure sensitivity.
This commit is contained in:
Joshua Leung 2015-08-07 01:33:53 +12:00
parent c587302ea1
commit e660079e47
Notes: blender-bot 2023-02-14 09:03:47 +01:00
Referenced by issue #44932, Grease Pencil: In the line-drawing mode a tablet pen produces non-deterministic line with.
1 changed files with 5 additions and 9 deletions

View File

@ -342,29 +342,25 @@ static short gp_stroke_addpoint(tGPsdata *p, const int mval[2], float pressure,
/* store settings */
copy_v2_v2_int(&pt->x, mval);
pt->pressure = pressure;
pt->pressure = 1.0f; /* T44932 - Pressure vals are unreliable, so ignore for now */
pt->time = (float)(curtime - p->inittime);
/* increment buffer size */
gpd->sbuffer_size++;
}
else {
/* normally, we just reset the endpoint to the latest value
/* just reset the endpoint to the latest value
* - assume that pointers for this are always valid...
*/
pt = ((tGPspoint *)(gpd->sbuffer) + 1);
/* store settings */
copy_v2_v2_int(&pt->x, mval);
pt->pressure = pressure;
pt->pressure = 1.0f; /* T44932 - Pressure vals are unreliable, so ignore for now */
pt->time = (float)(curtime - p->inittime);
/* if this is just the second point we've added, increment the buffer size
* so that it will be drawn properly...
* otherwise, just leave it alone, otherwise we get problems
*/
if (gpd->sbuffer_size != 2)
gpd->sbuffer_size = 2;
/* now the buffer has 2 points (and shouldn't be allowed to get any larger) */
gpd->sbuffer_size = 2;
}
/* can keep carrying on this way :) */