painting on resize