Simplify the canvas size calculation