Skip to content

Commit 98dec9b

Browse files
author
Alexander Korotkov
committed
Fix sline_sline_pos function. Previously it erroneously rejects the
consecutive segments that lay on the same line and continue each other. Author: Sergey Karpov
1 parent 9844234 commit 98dec9b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

line.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,15 @@ sline_sline_pos(const SLine *l1, const SLine *l2)
494494
vector3d_spoint(&p[2], &v[1][0]);
495495
vector3d_spoint(&p[3], &v[1][1]);
496496

497+
/* check connected lines */
498+
if (FPgt(il2->length, 0.0) && (vector3d_eq(&v[0][0], &v[1][0]) ||
499+
vector3d_eq(&v[0][0], &v[1][1]) ||
500+
vector3d_eq(&v[0][1], &v[1][0]) ||
501+
vector3d_eq(&v[0][1], &v[1][1])))
502+
{
503+
return PGS_LINE_CONNECT;
504+
}
505+
497506
/* Check, sl2 is at equator */
498507
if (FPzero(p[2].lat) && FPzero(p[3].lat))
499508
{
@@ -520,15 +529,6 @@ sline_sline_pos(const SLine *l1, const SLine *l2)
520529

521530
/* Now sl2 is not at equator */
522531

523-
/* check connected lines */
524-
if (FPgt(il2->length, 0.0) && (vector3d_eq(&v[0][0], &v[1][0]) ||
525-
vector3d_eq(&v[0][0], &v[1][1]) ||
526-
vector3d_eq(&v[0][1], &v[1][0]) ||
527-
vector3d_eq(&v[0][1], &v[1][1])))
528-
{
529-
return PGS_LINE_CONNECT;
530-
}
531-
532532
if (FPle(il2->length, seg_length))
533533
{
534534
bool a1 = (FPge(p[2].lat, 0.0) && FPle(p[3].lat, 0.0));

0 commit comments

Comments
 (0)