From 18023094c214b88be50aa68a89785546c119430d Mon Sep 17 00:00:00 2001 From: Matthew Whitaker Date: Thu, 20 Oct 2022 16:59:56 -0600 Subject: [PATCH] fix: Fix issue with font scaling introduced in 3.0.0-alpha.6 --- lib/src/css_box_widget.dart | 9 ++++----- lib/src/style/fontsize.dart | 6 +----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/src/css_box_widget.dart b/lib/src/css_box_widget.dart index 727095c0f4..6944e2d790 100644 --- a/lib/src/css_box_widget.dart +++ b/lib/src/css_box_widget.dart @@ -87,16 +87,15 @@ class CssBoxWidget extends StatelessWidget { return Container(); } - 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, ); } diff --git a/lib/src/style/fontsize.dart b/lib/src/style/fontsize.dart index d3ed2c13ef..793124fe14 100644 --- a/lib/src/style/fontsize.dart +++ b/lib/src/style/fontsize.dart @@ -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);