Prevent repainting on every resize event.