Add method scailing
refactor class rectanglePainter