Skip to content

fix: Fix issue with font scaling introduced in 3.0.0-alpha.6 #1173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/src/css_box_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,15 @@ class CssBoxWidget extends StatelessWidget {
}
}

return Text.rich(
TextSpan(
return RichText(
text: TextSpan(
style: style.generateTextStyle(),
children: children,
),
style: style.generateTextStyle(),
textAlign: style.textAlign,
textAlign: style.textAlign ?? TextAlign.start,
textDirection: style.direction,
maxLines: style.maxLines,
overflow: style.textOverflow,
overflow: style.textOverflow ?? TextOverflow.clip,
);
}

Expand Down
6 changes: 1 addition & 5 deletions lib/src/style/fontsize.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ class FontSize extends LengthOrPercent {

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