add setCanvasSize function