From c74af9d2d3ab075633cdba7b121c21b7ae5d0355 Mon Sep 17 00:00:00 2001 From: ellson Date: Mon, 28 Nov 2005 23:33:06 +0000 Subject: [PATCH] fix for thinlines in polylines --- lib/common/gdgen.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/common/gdgen.c b/lib/common/gdgen.c index 2d1b292e3..0ed7bee81 100644 --- a/lib/common/gdgen.c +++ b/lib/common/gdgen.c @@ -605,9 +605,11 @@ static void gd_textline(point p, textline_t * line) ROUND(mp.x), ROUND(mp.y), str, &strex); #if 0 gdImagePolygon(im, (gdPointPtr) brect, 4, cstk[SP].pencolor); +#endif +#if 0 fprintf(stderr, - "textline: font=%s size=%g width=%g dpi=%d width/dpi=%g\n", - fontlist, fontsz, (double) (brect[4] - brect[0]), + "textline: font=%s size=%g pos=%g,%g width=%g dpi=%d width/dpi=%g\n", + fontlist, fontsz, mp.x, mp.y, (double) (brect[4] - brect[0]), strex.hdpi, (((double) (brect[4] - brect[0])) / strex.hdpi)); #endif @@ -895,8 +897,9 @@ static void gd_polyline(point * A, int n) pen = cstk[SP].pencolor; } width = cstk[SP].penwidth * CompScale; + if (width < WIDTH_NORMAL) + width = WIDTH_NORMAL; /* gd can't do thin lines */ gdImageSetThickness(im, width); -#if 1 if (width != WIDTH_NORMAL) { brush = gdImageCreate(width, width); gdImagePaletteCopy(brush, im); @@ -909,7 +912,6 @@ static void gd_polyline(point * A, int n) else pen = gdBrushed; } -#endif p.x = A[0].x; p.y = A[0].y; p = gdpt(p); -- 2.40.0