encapsulated canvas resizing