call beginPath before rect