Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Prev Previous commit
Next Next commit
whoops
  • Loading branch information
LongCatIsLooong committed May 23, 2024
commit 70451987c151ce9f665743f429d8929c6370cf2d
26 changes: 13 additions & 13 deletions lib/web_ui/test/ui/paragraph_builder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,36 +85,36 @@ Future<void> testMain() async {
test('kTextHeightNone unsets the height multiplier', () {
const double fontSize = 10;
const String text = 'A';
final ui.ParagraphBuilder builder = ui.ParagraphBuilder(ui.ParagraphStyle(fontSize: fontSize, height: 10));
builder.pushStyle(ui.TextStyle(height: ui.kTextHeightNone));
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(fontSize: fontSize, height: 10));
builder.pushStyle(TextStyle(height: kTextHeightNone));
builder.addText(text);
final ui.Paragraph paragraph = builder.build()
..layout(const ui.ParagraphConstraints(width: 1000));
final Paragraph paragraph = builder.build()
..layout(const ParagraphConstraints(width: 1000));
expect(paragraph.height, fontSize);
});

test('kTextHeightNone ParagraphStyle', () {
const double fontSize = 10;
final ui.ParagraphBuilder builder = ui.ParagraphBuilder(
ui.ParagraphStyle(fontSize: fontSize, height: ui.kTextHeightNone),
final ParagraphBuilder builder = ParagraphBuilder(
ParagraphStyle(fontSize: fontSize, height: kTextHeightNone),
);
builder.addText('A');
final ui.Paragraph paragraph = builder.build()
..layout(const ui.ParagraphConstraints(width: 1000));
final Paragraph paragraph = builder.build()
..layout(const ParagraphConstraints(width: 1000));
expect(paragraph.height, fontSize);
});

test('kTextHeightNone StrutStyle', () {
const double fontSize = 10;
final ui.ParagraphBuilder builder = ui.ParagraphBuilder(
ui.ParagraphStyle(
final ParagraphBuilder builder = ParagraphBuilder(
ParagraphStyle(
fontSize: 100,
strutStyle: ui.StrutStyle(forceStrutHeight: true, height: ui.kTextHeightNone, fontSize: fontSize),
strutStyle: StrutStyle(forceStrutHeight: true, height: kTextHeightNone, fontSize: fontSize),
),
);
builder.addText('A');
final ui.Paragraph paragraph = builder.build()
..layout(const ui.ParagraphConstraints(width: 1000));
final Paragraph paragraph = builder.build()
..layout(const ParagraphConstraints(width: 1000));
expect(paragraph.height, fontSize);
});
}