Fix animation slowdown while resizing