Fix angle follow calculation on vertical or horizontal lines (#4839)