Fix text painter longest line resizing logic for TextWidthBasis.longestLine (#143024)
Fixes https://github.com/flutter/flutter/issues/142309.
This commit is contained in:
@@ -35,7 +35,7 @@ class ProductCard extends StatelessWidget {
|
||||
|
||||
// The fontSize to use for computing the heuristic UI scaling factor.
|
||||
const double defaultFontSize = 14.0;
|
||||
final double containerScaingFactor = MediaQuery.textScalerOf(context).scale(defaultFontSize) / defaultFontSize;
|
||||
final double containerScalingFactor = MediaQuery.textScalerOf(context).scale(defaultFontSize) / defaultFontSize;
|
||||
|
||||
return ScopedModelDescendant<AppStateModel>(
|
||||
builder: (BuildContext context, Widget? child, AppStateModel model) {
|
||||
@@ -56,7 +56,7 @@ class ProductCard extends StatelessWidget {
|
||||
child: imageWidget,
|
||||
),
|
||||
SizedBox(
|
||||
height: kTextBoxHeight * containerScaingFactor,
|
||||
height: kTextBoxHeight * containerScalingFactor,
|
||||
width: 121.0,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
|
||||
@@ -180,7 +180,7 @@ class _DemoItem extends StatelessWidget {
|
||||
final bool isDark = theme.brightness == Brightness.dark;
|
||||
// The fontSize to use for computing the heuristic UI scaling factor.
|
||||
const double defaultFontSize = 14.0;
|
||||
final double containerScaingFactor = MediaQuery.textScalerOf(context).scale(defaultFontSize) / defaultFontSize;
|
||||
final double containerScalingFactor = MediaQuery.textScalerOf(context).scale(defaultFontSize) / defaultFontSize;
|
||||
return RawMaterialButton(
|
||||
splashColor: theme.primaryColor.withOpacity(0.12),
|
||||
highlightColor: Colors.transparent,
|
||||
@@ -188,7 +188,7 @@ class _DemoItem extends StatelessWidget {
|
||||
_launchDemo(context);
|
||||
},
|
||||
child: Container(
|
||||
constraints: BoxConstraints(minHeight: _kDemoItemHeight * containerScaingFactor),
|
||||
constraints: BoxConstraints(minHeight: _kDemoItemHeight * containerScalingFactor),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
|
||||
Reference in New Issue
Block a user