diff options
author | Joshua Leung <aligorith@gmail.com> | 2015-08-06 16:33:53 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-08-06 16:48:26 +0300 |
commit | e660079e47700f29fc227e357d0f16dbfb6986d4 (patch) | |
tree | 00d185332e8d41b4f396c65d0aed93a6127e2503 /source/blender | |
parent | c587302ea14debaa109800de36e90f9d578a658b (diff) |
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.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index f3eb1612576..b77a7225158 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -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 :) */ |