@@ -15,11 +15,6 @@ namespace SixLabors.ImageSharp.Drawing.Processing;
1515/// </summary>
1616public sealed class RadialGradientBrush : GradientBrush
1717{
18- private readonly PointF center0 ;
19- private readonly float radius0 ;
20- private readonly PointF ? center1 ; // null means single-circle form
21- private readonly float ? radius1 ;
22-
2318 /// <summary>
2419 /// Initializes a new instance of the <see cref="RadialGradientBrush"/> class using a single circle.
2520 /// </summary>
@@ -34,10 +29,10 @@ public RadialGradientBrush(
3429 params ColorStop [ ] colorStops )
3530 : base ( repetitionMode , colorStops )
3631 {
37- this . center0 = center ;
38- this . radius0 = radius ;
39- this . center1 = null ;
40- this . radius1 = null ;
32+ this . Center0 = center ;
33+ this . Radius0 = radius ;
34+ this . Center1 = null ;
35+ this . Radius1 = null ;
4136 }
4237
4338 /// <summary>
@@ -58,49 +53,49 @@ public RadialGradientBrush(
5853 params ColorStop [ ] colorStops )
5954 : base ( repetitionMode , colorStops )
6055 {
61- this . center0 = startCenter ;
62- this . radius0 = startRadius ;
63- this . center1 = endCenter ;
64- this . radius1 = endRadius ;
56+ this . Center0 = startCenter ;
57+ this . Radius0 = startRadius ;
58+ this . Center1 = endCenter ;
59+ this . Radius1 = endRadius ;
6560 }
6661
6762 /// <summary>
6863 /// Gets the center of the starting circle.
6964 /// </summary>
70- public PointF Center0 => this . center0 ;
65+ public PointF Center0 { get ; }
7166
7267 /// <summary>
7368 /// Gets the radius of the starting circle.
7469 /// </summary>
75- public float Radius0 => this . radius0 ;
70+ public float Radius0 { get ; }
7671
7772 /// <summary>
7873 /// Gets the center of the ending circle, or <see langword="null"/> for single-circle form.
7974 /// </summary>
80- public PointF ? Center1 => this . center1 ;
75+ public PointF ? Center1 { get ; }
8176
8277 /// <summary>
8378 /// Gets the radius of the ending circle, or <see langword="null"/> for single-circle form.
8479 /// </summary>
85- public float ? Radius1 => this . radius1 ;
80+ public float ? Radius1 { get ; }
8681
8782 /// <summary>
8883 /// Gets a value indicating whether this is a two-circle radial gradient.
8984 /// </summary>
90- public bool IsTwoCircle => this . center1 . HasValue && this . radius1 . HasValue ;
85+ public bool IsTwoCircle => this . Center1 . HasValue && this . Radius1 . HasValue ;
9186
9287 /// <inheritdoc/>
9388 public override Brush Transform ( Matrix4x4 matrix )
9489 {
95- PointF tc0 = PointF . Transform ( this . center0 , matrix ) ;
90+ PointF tc0 = PointF . Transform ( this . Center0 , matrix ) ;
9691 float scale = MatrixUtilities . GetAverageScale ( in matrix ) ;
9792 if ( this . IsTwoCircle )
9893 {
99- PointF tc1 = PointF . Transform ( this . center1 ! . Value , matrix ) ;
100- return new RadialGradientBrush ( tc0 , this . radius0 * scale , tc1 , this . radius1 ! . Value * scale , this . RepetitionMode , this . ColorStopsArray ) ;
94+ PointF tc1 = PointF . Transform ( this . Center1 ! . Value , matrix ) ;
95+ return new RadialGradientBrush ( tc0 , this . Radius0 * scale , tc1 , this . Radius1 ! . Value * scale , this . RepetitionMode , this . ColorStopsArray ) ;
10196 }
10297
103- return new RadialGradientBrush ( tc0 , this . radius0 * scale , this . RepetitionMode , this . ColorStopsArray ) ;
98+ return new RadialGradientBrush ( tc0 , this . Radius0 * scale , this . RepetitionMode , this . ColorStopsArray ) ;
10499 }
105100
106101 /// <inheritdoc/>
@@ -109,18 +104,18 @@ public override bool Equals(Brush? other)
109104 if ( other is RadialGradientBrush b )
110105 {
111106 return base . Equals ( other )
112- && this . center0 . Equals ( b . center0 )
113- && this . radius0 . Equals ( b . radius0 )
114- && Nullable . Equals ( this . center1 , b . center1 )
115- && Nullable . Equals ( this . radius1 , b . radius1 ) ;
107+ && this . Center0 . Equals ( b . Center0 )
108+ && this . Radius0 . Equals ( b . Radius0 )
109+ && Nullable . Equals ( this . Center1 , b . Center1 )
110+ && Nullable . Equals ( this . Radius1 , b . Radius1 ) ;
116111 }
117112
118113 return false ;
119114 }
120115
121116 /// <inheritdoc/>
122117 public override int GetHashCode ( )
123- => HashCode . Combine ( base . GetHashCode ( ) , this . center0 , this . radius0 , this . center1 , this . radius1 ) ;
118+ => HashCode . Combine ( base . GetHashCode ( ) , this . Center0 , this . Radius0 , this . Center1 , this . Radius1 ) ;
124119
125120 /// <inheritdoc />
126121 public override BrushApplicator < TPixel > CreateApplicator < TPixel > (
@@ -132,10 +127,10 @@ public override BrushApplicator<TPixel> CreateApplicator<TPixel>(
132127 configuration ,
133128 options ,
134129 targetRegion ,
135- this . center0 ,
136- this . radius0 ,
137- this . center1 ,
138- this . radius1 ,
130+ this . Center0 ,
131+ this . Radius0 ,
132+ this . Center1 ,
133+ this . Radius1 ,
139134 this . ColorStopsArray ,
140135 this . RepetitionMode ) ;
141136
0 commit comments