Fix the bug about opposite direction of line.