This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +3
-23
lines changed Expand file tree Collapse file tree 2 files changed +3
-23
lines changed Original file line number Diff line number Diff line change @@ -157,35 +157,15 @@ class CanvasParagraph implements ui.Paragraph {
157
157
cssStyle
158
158
..position = 'absolute'
159
159
// Prevent the browser from doing any line breaks in the paragraph. We want
160
- // to insert our own <BR> breaks based on layout results .
160
+ // to have full control of the paragraph layout.
161
161
..whiteSpace = 'pre' ;
162
162
163
- // if (width > longestLine) {
164
- // In this case, we set the width so that the CSS text-align property
165
- // works correctly.
166
- // When `longestLine` is >= `paragraph.width` that means the DOM element
167
- // will automatically size itself to fit the longest line, so there's no
168
- // need to set an explicit width.
169
- cssStyle.width = '${width }px' ;
170
- // }
171
-
172
- // if (paragraphStyle.maxLines != null || paragraphStyle.ellipsis != null) {
173
- // cssStyle
174
- // ..overflow = 'hidden'
175
- // ..height = '${height}px';
176
- // }
177
-
178
163
// 2. Append all spans to the paragraph.
179
164
180
165
html.HtmlElement ? lastSpanElement;
181
166
final List <EngineLineMetrics > lines = computeLineMetrics ();
182
167
183
168
for (int i = 0 ; i < lines.length; i++ ) {
184
- // Insert a <BR> element before each line except the first line.
185
- if (i > 0 ) {
186
- rootElement.append (html.document.createElement ('br' ));
187
- }
188
-
189
169
final EngineLineMetrics line = lines[i];
190
170
final List <RangeBox > boxes = line.boxes;
191
171
final StringBuffer buffer = StringBuffer ();
Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ Future<void> testMain() async {
371
371
});
372
372
373
373
void testFontFeatures (EngineCanvas canvas) {
374
- const String text = 'Aa Bb Dd Ee Ff Difficult' ;
374
+ const String text = 'Bb Difficult ' ;
375
375
const FontFeature enableSmallCaps = FontFeature ('smcp' );
376
376
const FontFeature disableSmallCaps = FontFeature ('smcp' , 0 );
377
377
@@ -446,7 +446,7 @@ Future<void> testMain() async {
446
446
enableOnum,
447
447
],
448
448
));
449
- builder.addText ('$text - $numeric ' );
449
+ builder.addText ('$text $numeric ' );
450
450
builder.pop (); // enableSmallCaps, enableOnum
451
451
},
452
452
)..layout (constrain (double .infinity));
You can’t perform that action at this time.
0 commit comments