Skip to content

Commit

Permalink
fix: Fix issue with font scaling introduced in 3.0.0-alpha.6 (#1173)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sub6Resources authored Oct 21, 2022
1 parent 6571e3b commit c75e0df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
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

0 comments on commit c75e0df

Please sign in to comment.