Support animation when the size is changed