resing and repainting