fixed corner case in line draw