fixed #1934: added function to reset canvas while keeping the size

added function to reset canvas while keeping the size