resize history canvas dynamically