Recalculate and apply canvas dimensions when redrawing.
Micro-optimisation.