Optimize drawLine