diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-14 05:35:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-14 05:35:20 +0400 |
commit | 4e118bb22f246468a6e0a5524c87c0243b7a3d5d (patch) | |
tree | 7326c91636f991c8bcaa95fe0efd49aa570f4e65 /source/blender/editors/gpencil | |
parent | 7eadd540d48ceaae0078d48a05ede663df3ea01a (diff) | |
parent | be24b4dfccfda38c776545d571897ab17ecc96a6 (diff) |
svn merge ^/trunk/blender -r40890:40950
Diffstat (limited to 'source/blender/editors/gpencil')
-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); } |