From 09950d0720039f12c03ef380e37115405db3a5fc Mon Sep 17 00:00:00 2001 From: erg Date: Tue, 12 Jul 2011 18:12:54 +0000 Subject: [PATCH] Make sure width=0 is supported for shape=point --- lib/common/shapes.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/common/shapes.c b/lib/common/shapes.c index 7369ce46b..c5c5a37e2 100644 --- a/lib/common/shapes.c +++ b/lib/common/shapes.c @@ -1690,13 +1690,20 @@ static void point_init(node_t * n) * if both are set, use smallest. * if neither, use default */ - w = late_double(n, N_width, MAXDOUBLE, MIN_POINT); - h = late_double(n, N_height, MAXDOUBLE, MIN_POINT); + w = late_double(n, N_width, MAXDOUBLE, 0.0); + h = late_double(n, N_height, MAXDOUBLE, 0.0); w = MIN(w, h); if ((w == MAXDOUBLE) && (h == MAXDOUBLE)) /* neither defined */ ND_width(n) = ND_height(n) = DEF_POINT; - else + else { + w = MIN(w, h); + /* If w == 0, use it; otherwise, make w no less than MIN_POINT due + * to the restrictions mentioned above. + */ + if (w > 0.0) + w = MAX(w,MIN_POINT); ND_width(n) = ND_height(n) = w; + } sz = ND_width(n) * POINTS_PER_INCH; peripheries = late_int(n, N_peripheries, peripheries, 0); -- 2.40.0