Dynamically set canvas size.