8000 fix: Fix issue with font scaling introduced in 3.0.0-alpha.6 · Sub6Resources/flutter_html@1802309 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1802309

Browse files
committed
fix: Fix issue with font scaling introduced in 3.0.0-alpha.6
1 parent e99e2cc commit 1802309

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

lib/src/css_box_widget.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,15 @@ class CssBoxWidget extends StatelessWidget {
8787
return Container();
8888
}
8989

90-
return Text.rich(
91-
TextSpan(
90+
return RichText(
91+
text: TextSpan(
9292
style: style.generateTextStyle(),
9393
children: children,
9494
),
95-
style: style.generateTextStyle(),
96-
textAlign: style.textAlign,
95+
textAlign: style.textAlign ?? TextAlign.start,
9796
textDirection: style.direction,
9897
maxLines: style.maxLines,
99-
overflow: style.textOverflow,
98+
overflow: style.textOverflow ?? TextOverflow.clip,
10099
);
101100
}
102101

lib/src/style/fontsize.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ class FontSize extends LengthOrPercent {
55

66
// These values are calculated based off of the default (`medium`)
77
// being 14px.
8-
//
9-
// TODO(Sub6Resources): This seems to override Flutter's accessibility text scaling.
10-
//
11-
// Negative values are computed during parsing to be a percentage of
12-
// the parent style's font size.
8+
// TODO calculate from https://w3c.github.io/csswg-drafts/css-fonts-3/#absolute-size-value
139
static final xxSmall = FontSize(7.875);
1410
static final xSmall = FontSize(8.75);
1511
static final small = FontSize(11.375);

0 commit comments

Comments
 (0)
0