Reland "remove usage to applyTextScaleFactorToWidgetSpan" (#62587)
This reverts commit 561735ad89a14c63597f9acb77d447c7e0ed4fec.
diff --git a/packages/flutter/lib/src/rendering/paragraph.dart b/packages/flutter/lib/src/rendering/paragraph.dart
index c764eac..d407403 100644
--- a/packages/flutter/lib/src/rendering/paragraph.dart
+++ b/packages/flutter/lib/src/rendering/paragraph.dart
@@ -79,13 +79,6 @@
StrutStyle strutStyle,
TextWidthBasis textWidthBasis = TextWidthBasis.parent,
ui.TextHeightBehavior textHeightBehavior,
- @Deprecated(
- 'This parameter is a temporary flag to migrate the internal tests and '
- 'should not be used in other contexts. For more details, please check '
- 'https://github.com/flutter/flutter/issues/59316. '
- 'This feature was deprecated after v1.19.0.'
- )
- bool applyTextScaleFactorToWidgetSpan = false,
List<RenderBox> children,
}) : assert(text != null),
assert(text.debugAssertIsValid()),
@@ -98,7 +91,6 @@
assert(textWidthBasis != null),
_softWrap = softWrap,
_overflow = overflow,
- _applyTextScaleFactorToWidgetSpan = applyTextScaleFactorToWidgetSpan,
_textPainter = TextPainter(
text: text,
textAlign: textAlign,
@@ -298,8 +290,6 @@
markNeedsLayout();
}
- final bool _applyTextScaleFactorToWidgetSpan;
-
@override
double computeMinIntrinsicWidth(double height) {
if (!_canComputeIntrinsics()) {
@@ -540,8 +530,7 @@
// The content will be enlarged by textScaleFactor during painting phase.
// We reduce constraint by textScaleFactor so that the content will fit
// into the box once it is enlarged.
- if (_applyTextScaleFactorToWidgetSpan)
- boxConstraints = boxConstraints / textScaleFactor;
+ boxConstraints = boxConstraints / textScaleFactor;
while (child != null) {
// Only constrain the width to the maximum width of the paragraph.
// Leave height unconstrained, which will overflow if expanded past.
diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart
index 1f4d596..1ea6d7c 100644
--- a/packages/flutter/lib/src/widgets/basic.dart
+++ b/packages/flutter/lib/src/widgets/basic.dart
@@ -5201,7 +5201,6 @@
assert(textScaleFactor != null),
assert(maxLines == null || maxLines > 0),
assert(textWidthBasis != null),
- _applyTextScaleFactorToWidgetSpan = applyTextScaleFactorToWidgetSpan,
super(key: key, children: _extractChildren(text));
// Traverses the InlineSpan tree and depth-first collects the list of
@@ -5279,8 +5278,6 @@
/// {@macro flutter.dart:ui.textHeightBehavior}
final ui.TextHeightBehavior textHeightBehavior;
- final bool _applyTextScaleFactorToWidgetSpan;
-
@override
RenderParagraph createRenderObject(BuildContext context) {
assert(textDirection != null || debugCheckHasDirectionality(context));
@@ -5294,7 +5291,6 @@
strutStyle: strutStyle,
textWidthBasis: textWidthBasis,
textHeightBehavior: textHeightBehavior,
- applyTextScaleFactorToWidgetSpan: _applyTextScaleFactorToWidgetSpan,
locale: locale ?? Localizations.localeOf(context, nullOk: true),
);
}
diff --git a/packages/flutter/lib/src/widgets/text.dart b/packages/flutter/lib/src/widgets/text.dart
index ac82fbe..cbe9be0 100644
--- a/packages/flutter/lib/src/widgets/text.dart
+++ b/packages/flutter/lib/src/widgets/text.dart
@@ -361,7 +361,6 @@
'A non-null String must be provided to a Text widget.',
),
textSpan = null,
- _applyTextScaleFactorToWidgetSpan = true,
super(key: key);
/// Creates a text widget with a [InlineSpan].
@@ -401,7 +400,6 @@
'A non-null TextSpan must be provided to a Text.rich widget.',
),
data = null,
- _applyTextScaleFactorToWidgetSpan = applyTextScaleFactorToWidgetSpan,
super(key: key);
/// The text to display.
@@ -504,8 +502,6 @@
/// {@macro flutter.dart:ui.textHeightBehavior}
final ui.TextHeightBehavior textHeightBehavior;
- final bool _applyTextScaleFactorToWidgetSpan;
-
@override
Widget build(BuildContext context) {
final DefaultTextStyle defaultTextStyle = DefaultTextStyle.of(context);
@@ -525,7 +521,6 @@
strutStyle: strutStyle,
textWidthBasis: textWidthBasis ?? defaultTextStyle.textWidthBasis,
textHeightBehavior: textHeightBehavior ?? defaultTextStyle.textHeightBehavior ?? DefaultTextHeightBehavior.of(context),
- applyTextScaleFactorToWidgetSpan: _applyTextScaleFactorToWidgetSpan,
text: TextSpan(
style: effectiveTextStyle,
text: data,
diff --git a/packages/flutter/test/widgets/text_test.dart b/packages/flutter/test/widgets/text_test.dart
index 6467117..bb0f969 100644
--- a/packages/flutter/test/widgets/text_test.dart
+++ b/packages/flutter/test/widgets/text_test.dart
@@ -186,7 +186,6 @@
key: key,
textDirection: TextDirection.ltr,
textScaleFactor: textScaleFactor,
- applyTextScaleFactorToWidgetSpan: true,
),
),
),
@@ -215,7 +214,6 @@
key: key,
textDirection: TextDirection.ltr,
textScaleFactor: textScaleFactor,
- applyTextScaleFactorToWidgetSpan: true,
),
),
),