Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-10-12 07:46:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-12 07:46:38 +0400
commite2e8cf36da1041949a2501c087d10ea1303fc0be (patch)
treea0350690d4ef1b81f20157863b422d8f1c289385 /source/blender/editors/gpencil/drawgpencil.c
parent51cbfb396128bf800c0b53fd922a87dc4fe0ff79 (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.c9
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);
}