fixed #2546 where lines appeared through rectangle