Improve polyline drawing