Fix coordinate transformation for Line2D coordinates

See code comment for problem description and solution.