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

Skip to content

Commit c75e0df

Browse files
fix: Fix issue with font scaling introduced in 3.0.0-alpha.6 (#1173)
1 parent 6571e3b commit c75e0df

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
@@ -103,16 +103,15 @@ class CssBoxWidget extends StatelessWidget {
103103
}
104104
}
105105

106-
return Text.rich(
107-
TextSpan(
106+
return RichText(
107+
text: TextSpan(
108108
style: style.generateTextStyle(),
109109
children: children,
110110
),
111-
style: style.generateTextStyle(),
112-
textAlign: style.textAlign,
111+
textAlign: style.textAlign ?? TextAlign.start,
113112
textDirection: style.direction,
114113
maxLines: style.maxLines,
115-
overflow: style.textOverflow,
114+
overflow: style.textOverflow ?? TextOverflow.clip,
116115
);
117116
}
118117

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