Fix divide by zero error with vertical edges.