@@ -2310,44 +2310,25 @@ class Gradient extends Shader {
2310
2310
/// If `matrix4` is provided, the gradient fill will be transformed by the
2311
2311
/// specified 4x4 matrix relative to the local coordinate system. `matrix4` must
2312
2312
/// be a column-major matrix packed into a list of 16 values.
2313
- ///
2314
- /// If `focal` is provided and not equal to `center` or `focalRadius` is
2315
- /// provided and not equal to 0.0, the generated shader will be a two point
2316
- /// conical radial gradient, with `focal` being the center of the focal
2317
- /// circle and `focalRadius` being the radius of that circle. If `focal` is
2318
- /// provided and not equal to `center` , at least one of the two offsets must
2319
- /// not be equal to [Offset.zero] .
2320
2313
Gradient .radial (
2321
2314
Offset center,
2322
2315
double radius,
2323
2316
List <Color > colors, [
2324
2317
List <double > colorStops,
2325
2318
TileMode tileMode = TileMode .clamp,
2326
- Float64List matrix4,
2327
- Offset focal,
2328
- double focalRadius
2319
+ Float64List matrix4
2329
2320
]) : assert (_offsetIsValid (center)),
2330
2321
assert (colors != null ),
2331
2322
assert (tileMode != null ),
2332
2323
assert (matrix4 == null || _matrix4IsValid (matrix4)),
2333
2324
super ._() {
2334
- focal ?? = center;
2335
- focalRadius ?? = 0.0 ;
2336
2325
_validateColorStops (colors, colorStops);
2337
2326
final Int32List colorsBuffer = _encodeColorList (colors);
2338
2327
final Float32List colorStopsBuffer = colorStops == null ? null : new Float32List .fromList (colorStops);
2339
-
2340
- if (center == focal && focalRadius != 0.0 ) {
2341
- _constructor ();
2342
- _initRadial (center.dx, center.dy, radius, colorsBuffer, colorStopsBuffer, tileMode.index, matrix4);
2343
- } else {
2344
- assert (center != Offset .zero || focal != Offset .zero); // will result in nullptr in Skia side
2345
- _constructor ();
2346
- _initConical (focal.dx, focal.dy, focalRadius, center.dx, center.dy, radius, colorsBuffer, colorStopsBuffer, tileMode.index, matrix4);
2347
- }
2328
+ _constructor ();
2329
+ _initRadial (center.dx, center.dy, radius, colorsBuffer, colorStopsBuffer, tileMode.index, matrix4);
2348
2330
}
2349
2331
void _initRadial (double centerX, double centerY, double radius, Int32List colors, Float32List colorStops, int tileMode, Float64List matrix4) native 'Gradient_initRadial' ;
2350
- void _initConical (double startX, double startY, double startRadius, double endX, double endY, double endRadius, Int32List colors, Float32List colorStops, int tileMode, Float64List matrix4) native 'Gradient_initTwoPointConical' ;
2351
2332
2352
2333
/// Creates a sweep gradient centered at `center` that starts at `startAngle`
2353
2334
/// and ends at `endAngle` .
0 commit comments