Changeable brushes and gradient background

TO DO: I had a problem with the radial gradient type.
If gradientRadius >= 1 the whole rectangle paints in startColor value.
If gradientRadius < 1 the whole rectangle paints in endColor value.