support canvas size change