From e4aa701fbbb5c2b69b4e2ee983ad77004a9893cb Mon Sep 17 00:00:00 2001 From: Dmitry Karasik Date: Mon, 23 Sep 2024 14:03:52 +0200 Subject: [PATCH] minor beautufication of a corner case of fm::Outline --- img/region.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/img/region.c b/img/region.c index 93f91d20..ae6ab8a5 100644 --- a/img/region.c +++ b/img/region.c @@ -1001,8 +1001,10 @@ superimpose_outline( PRegionRec region, Point *pts, int count) if (!( region = union_hline( region, scanline2box, a.x, a.y, b.x - a.x + 1))) goto EXIT; } else { - DEBUG("vertex %d.%d\n", a.x,a.y); - if (!( region = union_hline( region, scanline2box, a.x, a.y, 1))) + int n = (abs(a.x-b.x)+1) / (abs(a.y-b.y)+1); + if ( n < 1 ) n = 1; + DEBUG("vertex %d.%d %d\n", a.x,a.y, n); + if (!( region = union_hline( region, scanline2box, a.x, a.y, n))) goto EXIT; } }