diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/Geo.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/generic/Geo.c b/generic/Geo.c index cf07dc3..069f53c 100644 --- a/generic/Geo.c +++ b/generic/Geo.c @@ -498,7 +498,8 @@ ShiftLine(ZnPoint *p1, else { dy_neg = False; } - if ((dy == 0) && (dx == 0)) { + if ((ABS(dy) < PRECISION_LIMIT) && (ABS(dx) < PRECISION_LIMIT)) { + printf("ShiftLine: segment is a point\n"); return; } if (dy <= dx) { @@ -534,7 +535,7 @@ IntersectLines(ZnPoint *a1, ZnPoint *b2, ZnPoint *pi) { - int dxadyb, dxbdya, dxadxb, dyadyb, p, q; + ZnReal dxadyb, dxbdya, dxadxb, dyadyb, p, q; dxadyb = (a2->x - a1->x)*(b2->y - b1->y); dxbdya = (b2->x - b1->x)*(a2->y - a1->y); |