Fix problem when resizing objects