diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-12 07:46:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-12 07:46:38 +0400 |
commit | e2e8cf36da1041949a2501c087d10ea1303fc0be (patch) | |
tree | a0350690d4ef1b81f20157863b422d8f1c289385 /source/blender/editors/gpencil/drawgpencil.c | |
parent | 51cbfb396128bf800c0b53fd922a87dc4fe0ff79 (diff) |
fix [#28882] grease pencil draw apperence seems to change wieght/thickness after a while
Diffstat (limited to 'source/blender/editors/gpencil/drawgpencil.c')
-rw-r--r-- | source/blender/editors/gpencil/drawgpencil.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index cfa9585868e..b87166c51ca 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -114,12 +114,14 @@ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thick /* don't draw stroke at all! */ } else { - float oldpressure = 0.0f; + float oldpressure = points[0].pressure; /* draw stroke curve */ if (G.f & G_DEBUG) setlinestyle(2); - + + glLineWidth(oldpressure * thickness); glBegin(GL_LINE_STRIP); + for (i=0, pt=points; i < totpoints && pt; i++, pt++) { /* if there was a significant pressure change, stop the curve, change the thickness of the stroke, * and continue drawing again (since line-width cannot change in middle of GL_LINE_STRIP) @@ -144,6 +146,9 @@ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thick glVertex2f(pt->x, pt->y); } glEnd(); + + /* reset for pradictable OpenGL context */ + glLineWidth(1.0f); if (G.f & G_DEBUG) setlinestyle(0); } |