Fix of a degenerate case, where there is a vertical segment on this vertical line and the contour follows from left to right or vice versa, leading to low,low or high,high intersections.