From 261be53a0050c5ccc67e7b0bc60e8d45845a9c19 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 28 Feb 2009 22:02:11 +0000 Subject: [PATCH] 1.3.3 --- doc/gl2ps.tex | 11 ++++++----- gl2ps.c | 27 +++++++++++++-------------- gl2ps.h | 5 ++--- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/doc/gl2ps.tex b/doc/gl2ps.tex index a71485b..82d6434 100644 --- a/doc/gl2ps.tex +++ b/doc/gl2ps.tex @@ -1,7 +1,7 @@ -% $Id: gl2ps.tex,v 1.227 2009-02-27 21:25:56 geuzaine Exp $ +% $Id: gl2ps.tex,v 1.228 2009-02-28 22:02:11 geuzaine Exp $ % % GL2PS, an OpenGL to PostScript Printing Library -% Copyright (C) 1999-2007 Christophe Geuzaine <geuz@geuz.org> +% Copyright (C) 1999-2009 C. Geuzaine % % This program is free software; you can redistribute it and/or % modify it under the terms of either: @@ -59,7 +59,7 @@ \title{GL2PS: an OpenGL to PostScript printing library} \author{Christophe Geuzaine} -\date{Version 1.3.3, ? ? 2009} +\date{Version 1.3.3, 28 February 2009} \maketitle @@ -999,8 +999,9 @@ seem to be available anymore). \item[1.3.2] (Nov 5, 2006) Fixed bug in polygon offset computation; fixed landscape mode in SVG; fixed potential out-of-bounds array access in stippling pattern parser. -\item[1.3.3] (, 2009) Fixed memory leak in PDF code; added - \dd{gl2psGetOptions}; nicer SVG rendering (crispEdges, font attributes). +\item[1.3.3] (Feb 28, 2009) Fixed memory leak in PDF code; added + \dd{gl2psGetOptions}; nicer SVG rendering (crispEdges, font attributes); + fixed possible divisions by zero. \end{description} \end{document} diff --git a/gl2ps.c b/gl2ps.c index 195e38c..da66f49 100644 --- a/gl2ps.c +++ b/gl2ps.c @@ -1,7 +1,6 @@ -/* $Id: gl2ps.c,v 1.252 2009-02-27 21:30:19 geuzaine Exp $ */ /* * GL2PS, an OpenGL to PostScript Printing Library - * Copyright (C) 1999-2007 Christophe Geuzaine <geuz@geuz.org> + * Copyright (C) 1999-2009 C. Geuzaine * * This program is free software; you can redistribute it and/or * modify it under the terms of either: @@ -1691,20 +1690,20 @@ static void gl2psRescaleAndOffset() (prim->verts[2].xyz[0] - prim->verts[1].xyz[0]) * (prim->verts[1].xyz[1] - prim->verts[0].xyz[1]); if(!GL2PS_ZERO(area)){ - dZdX = - ((prim->verts[2].xyz[1] - prim->verts[1].xyz[1]) * - (prim->verts[1].xyz[2] - prim->verts[0].xyz[2]) - - (prim->verts[1].xyz[1] - prim->verts[0].xyz[1]) * - (prim->verts[2].xyz[2] - prim->verts[1].xyz[2])) / area; - dZdY = - ((prim->verts[1].xyz[0] - prim->verts[0].xyz[0]) * - (prim->verts[2].xyz[2] - prim->verts[1].xyz[2]) - - (prim->verts[2].xyz[0] - prim->verts[1].xyz[0]) * - (prim->verts[1].xyz[2] - prim->verts[0].xyz[2])) / area; - maxdZ = (GLfloat)sqrt(dZdX * dZdX + dZdY * dZdY); + dZdX = + ((prim->verts[2].xyz[1] - prim->verts[1].xyz[1]) * + (prim->verts[1].xyz[2] - prim->verts[0].xyz[2]) - + (prim->verts[1].xyz[1] - prim->verts[0].xyz[1]) * + (prim->verts[2].xyz[2] - prim->verts[1].xyz[2])) / area; + dZdY = + ((prim->verts[1].xyz[0] - prim->verts[0].xyz[0]) * + (prim->verts[2].xyz[2] - prim->verts[1].xyz[2]) - + (prim->verts[2].xyz[0] - prim->verts[1].xyz[0]) * + (prim->verts[1].xyz[2] - prim->verts[0].xyz[2])) / area; + maxdZ = (GLfloat)sqrt(dZdX * dZdX + dZdY * dZdY); } else{ - maxdZ = 0.0F; + maxdZ = 0.0F; } dZ = factor * maxdZ + units; prim->verts[0].xyz[2] += dZ; diff --git a/gl2ps.h b/gl2ps.h index 8a7b86f..20b1caf 100644 --- a/gl2ps.h +++ b/gl2ps.h @@ -1,7 +1,6 @@ -/* $Id: gl2ps.h,v 1.115 2007-05-02 20:57:15 geuzaine Exp $ */ /* * GL2PS, an OpenGL to PostScript Printing Library - * Copyright (C) 1999-2007 Christophe Geuzaine <geuz@geuz.org> + * Copyright (C) 1999-2009 C. Geuzaine * * This program is free software; you can redistribute it and/or * modify it under the terms of either: @@ -85,7 +84,7 @@ 0.01 * GL2PS_MINOR_VERSION + \ 0.0001 * GL2PS_PATCH_VERSION) -#define GL2PS_COPYRIGHT "(C) 1999-2007 Christophe Geuzaine (geuz@geuz.org)" +#define GL2PS_COPYRIGHT "(C) 1999-2009 C. Geuzaine" /* Output file formats (the values and the ordering are important!) */ -- GitLab