Avoid to assign a less than 1 to canvas.width or canvas.height, because the viewport becomes unusable when restoring from size zero