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:
authorAntony Riakiotakis <kalast@gmail.com>2015-04-16 19:34:53 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-04-16 19:35:07 +0300
commita7cae2987d078da8a3cb9a293fbcdf3b6ab43ddb (patch)
tree7f2fa44b4bde79f7579ce8560f42c8bf1e7e6e7a /source/blender/editors
parent6589d07c8faa6f2705530ed0dfc6ec30a77c72f2 (diff)
OpenGL does not like line thickness less than 1.0.
Check here is not completely correct either, we should check against GL_ALIASED_LINE_WIDTH_RANGE and GL_SMOOTH_LINE_WIDTH_RANGE
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index d4d601b1e8d..08926926861 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -121,7 +121,7 @@ static void gp_draw_stroke_buffer(tGPspoint *points, int totpoints, short thickn
/* draw stroke curve */
if (G.debug & G_DEBUG) setlinestyle(2);
- glLineWidth(oldpressure * thickness);
+ glLineWidth(max_ff(oldpressure * thickness, 1.0));
glBegin(GL_LINE_STRIP);
for (i = 0, pt = points; i < totpoints && pt; i++, pt++) {
@@ -130,7 +130,7 @@ static void gp_draw_stroke_buffer(tGPspoint *points, int totpoints, short thickn
*/
if (fabsf(pt->pressure - oldpressure) > 0.2f) {
glEnd();
- glLineWidth(pt->pressure * thickness);
+ glLineWidth(max_ff(pt->pressure * thickness, 1.0f));
glBegin(GL_LINE_STRIP);
/* need to roll-back one point to ensure that there are no gaps in the stroke */
@@ -415,7 +415,7 @@ static void gp_draw_stroke_3d(bGPDspoint *points, int totpoints, short thickness
int i;
/* draw stroke curve */
- glLineWidth(curpressure * thickness);
+ glLineWidth(max_ff(curpressure * thickness, 1.0f));
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,
@@ -425,7 +425,7 @@ static void gp_draw_stroke_3d(bGPDspoint *points, int totpoints, short thickness
if (fabsf(pt->pressure - curpressure) > 0.2f / (float)thickness) {
glEnd();
curpressure = pt->pressure;
- glLineWidth(curpressure * thickness);
+ glLineWidth(max_ff(curpressure * thickness, 1.0f));
glBegin(GL_LINE_STRIP);
/* need to roll-back one point to ensure that there are no gaps in the stroke */