Add automatic canvas size fit mechanism