[overlay] Calculate ratio for segment intersection where one segment is degenerate