fixed a bug when an anchor forms a complete straight line