[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40948] trunk/blender/source/blender/ editors/gpencil/drawgpencil.c: fix [#28882] grease pencil draw apperence seems to change wieght/ thickness after a while
Campbell Barton
ideasman42 at gmail.com
Wed Oct 12 05:46:43 CEST 2011
Revision: 40948
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40948
Author: campbellbarton
Date: 2011-10-12 03:46:38 +0000 (Wed, 12 Oct 2011)
Log Message:
-----------
fix [#28882] grease pencil draw apperence seems to change wieght/thickness after a while
Modified Paths:
--------------
trunk/blender/source/blender/editors/gpencil/drawgpencil.c
Modified: trunk/blender/source/blender/editors/gpencil/drawgpencil.c
===================================================================
--- trunk/blender/source/blender/editors/gpencil/drawgpencil.c 2011-10-12 01:36:06 UTC (rev 40947)
+++ trunk/blender/source/blender/editors/gpencil/drawgpencil.c 2011-10-12 03:46:38 UTC (rev 40948)
@@ -114,12 +114,14 @@
/* 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 @@
glVertex2f(pt->x, pt->y);
}
glEnd();
+
+ /* reset for pradictable OpenGL context */
+ glLineWidth(1.0f);
if (G.f & G_DEBUG) setlinestyle(0);
}
More information about the Bf-blender-cvs
mailing list