implementations for canvas resizing