From b634319d94a4477253b0144814c47c2ec550cd24 Mon Sep 17 00:00:00 2001 From: Tom Gilbert Date: Mon, 9 Oct 2000 13:37:03 +0000 Subject: [PATCH] Better fix. SVN revision: 3570 --- src/rgbadraw.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/rgbadraw.c b/src/rgbadraw.c index 8d4c3ae..5a15a3d 100644 --- a/src/rgbadraw.c +++ b/src/rgbadraw.c @@ -1746,9 +1746,18 @@ __imlib_polygon_get_bounds(ImlibPoly poly, int *px1, int *py1, int *px2, *px2=0; *py2=0; - if (!poly || !poly->points || (poly->pointcount < 2)) + if (!poly || !poly->points || (poly->pointcount < 1)) return; + if(poly->pointcount == 1) + { + *px1 = poly->points[0].x; + *py1 = poly->points[1].x; + *px2 = *px1 + 1; + *py2 = *py1 + 1; + return; + } + for (i = 0; i < poly->pointcount; i++) GROW_BOUNDS(x1, y1, x2, y2, poly->points[i].x, poly->points[i].y);