Make marker line angle calculation more robust against duplicated vertices