handle drawing to canvas