@@ -37,14 +37,14 @@ class BenchTextOutOfPictureBounds extends SceneBuilderRecorder {
37
37
paragraphCount: 500 ,
38
38
minWordCountPerParagraph: 2 ,
39
39
maxWordCountPerParagraph: 4 ,
40
- widthConstraint: window .physicalSize.width / 2 ,
40
+ widthConstraint: view .physicalSize.width / 2 ,
41
41
color: red,
42
42
);
43
43
multiLineParagraphs = generateLaidOutParagraphs (
44
44
paragraphCount: 50 ,
45
45
minWordCountPerParagraph: 30 ,
46
46
maxWordCountPerParagraph: 49 ,
47
- widthConstraint: window .physicalSize.width / 2 ,
47
+ widthConstraint: view .physicalSize.width / 2 ,
48
48
color: green,
49
49
);
50
50
}
@@ -61,19 +61,19 @@ class BenchTextOutOfPictureBounds extends SceneBuilderRecorder {
61
61
void onDrawFrame (SceneBuilder sceneBuilder) {
62
62
final PictureRecorder pictureRecorder = PictureRecorder ();
63
63
final Canvas canvas = Canvas (pictureRecorder);
64
- final Size screenSize = window .physicalSize;
64
+ final Size viewSize = view .physicalSize;
65
65
const double padding = 10.0 ;
66
66
67
67
// Fills a single cell with random text.
68
68
void fillCellWithText (List <Paragraph > textSource) {
69
69
canvas.save ();
70
70
double topOffset = 0 ;
71
- while (topOffset < screenSize .height) {
71
+ while (topOffset < viewSize .height) {
72
72
final Paragraph paragraph =
73
73
textSource[_random.nextInt (textSource.length)];
74
74
75
75
// Give it enough space to make sure it ends up being a single-line paragraph.
76
- paragraph.layout (ParagraphConstraints (width: screenSize .width / 2 ));
76
+ paragraph.layout (ParagraphConstraints (width: viewSize .width / 2 ));
77
77
78
78
canvas.drawParagraph (paragraph, Offset .zero);
79
79
canvas.translate (0 , paragraph.height + padding);
@@ -83,12 +83,12 @@ class BenchTextOutOfPictureBounds extends SceneBuilderRecorder {
83
83
}
84
84
85
85
// Starting with the top-left cell, fill every cell with text.
86
- canvas.translate (- screenSize .width, - screenSize .height);
86
+ canvas.translate (- viewSize .width, - viewSize .height);
87
87
for (int row = 0 ; row < 3 ; row++ ) {
88
88
canvas.save ();
89
89
for (int col = 0 ; col < 3 ; col++ ) {
90
90
canvas.drawRect (
91
- Offset .zero & screenSize ,
91
+ Offset .zero & viewSize ,
92
92
Paint ()
93
93
..style = PaintingStyle .stroke
94
94
..strokeWidth = 2.0 ,
@@ -98,19 +98,19 @@ class BenchTextOutOfPictureBounds extends SceneBuilderRecorder {
98
98
99
99
// Fill multi-line text.
100
100
canvas.save ();
101
- canvas.translate (screenSize .width / 2 , 0 );
101
+ canvas.translate (viewSize .width / 2 , 0 );
102
102
fillCellWithText (multiLineParagraphs);
103
103
canvas.restore ();
104
104
105
105
// Shift to next column.
106
- canvas.translate (screenSize .width, 0 );
106
+ canvas.translate (viewSize .width, 0 );
107
107
}
108
108
109
109
// Undo horizontal shift.
110
110
canvas.restore ();
111
111
112
112
// Shift to next row.
113
- canvas.translate (0 , screenSize .height);
113
+ canvas.translate (0 , viewSize .height);
114
114
}
115
115
116
116
final Picture picture = pictureRecorder.endRecording ();
0 commit comments