File tree 1 file changed +6
-4
lines changed
dev/benchmarks/macrobenchmarks/lib/src
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,10 @@ class RRectBlur extends StatefulWidget {
11
11
const RRectBlur ({super .key});
12
12
13
13
@override
14
- State <RRectBlur > createState () => _DrawPointsPageState ();
14
+ State <RRectBlur > createState () => _RRectBlurPageState ();
15
15
}
16
16
17
- class _DrawPointsPageState extends State <RRectBlur >
17
+ class _RRectBlurPageState extends State <RRectBlur >
18
18
with SingleTickerProviderStateMixin {
19
19
late final AnimationController controller;
20
20
double tick = 0.0 ;
@@ -73,7 +73,8 @@ class PointsPainter extends CustomPainter {
73
73
}
74
74
final double halfHeight = size.height / 2.0 ;
75
75
const double freq = 0.25 ;
76
- for (int i = 0 ; i < size.width / 10 ; ++ i) {
76
+ const int circleCount = 40 ;
77
+ for (int i = 0 ; i < circleCount; ++ i) {
77
78
final double radius =
78
79
25 * cos (i + (1.0 * 2.0 * 3.1415 * tick) / 60.0 ) +
79
80
25 ;
@@ -84,8 +85,9 @@ class PointsPainter extends CustomPainter {
84
85
final double yval =
85
86
halfHeight * sin (i + (freq * 2.0 * 3.1415 * tick) / 60.0 ) +
86
87
halfHeight;
88
+ final double xval = (i.toDouble () / circleCount) * size.width;
87
89
canvas.drawCircle (
88
- Offset (10.0 * i , yval),
90
+ Offset (xval , yval),
89
91
50 ,
90
92
paint..color = kColors[i % kColors.length],
91
93
);
You can’t perform that action at this time.
0 commit comments