Unverified Commit 8663b3c4 authored by chunhtai's avatar chunhtai Committed by GitHub

Reland "remove usage to applyTextScaleFactorToWidgetSpan" (#62587)

This reverts commit 561735ad.
parent 94f76d61
...@@ -79,13 +79,6 @@ class RenderParagraph extends RenderBox ...@@ -79,13 +79,6 @@ class RenderParagraph extends RenderBox
StrutStyle strutStyle, StrutStyle strutStyle,
TextWidthBasis textWidthBasis = TextWidthBasis.parent, TextWidthBasis textWidthBasis = TextWidthBasis.parent,
ui.TextHeightBehavior textHeightBehavior, 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, List<RenderBox> children,
}) : assert(text != null), }) : assert(text != null),
assert(text.debugAssertIsValid()), assert(text.debugAssertIsValid()),
...@@ -98,7 +91,6 @@ class RenderParagraph extends RenderBox ...@@ -98,7 +91,6 @@ class RenderParagraph extends RenderBox
assert(textWidthBasis != null), assert(textWidthBasis != null),
_softWrap = softWrap, _softWrap = softWrap,
_overflow = overflow, _overflow = overflow,
_applyTextScaleFactorToWidgetSpan = applyTextScaleFactorToWidgetSpan,
_textPainter = TextPainter( _textPainter = TextPainter(
text: text, text: text,
textAlign: textAlign, textAlign: textAlign,
...@@ -298,8 +290,6 @@ class RenderParagraph extends RenderBox ...@@ -298,8 +290,6 @@ class RenderParagraph extends RenderBox
markNeedsLayout(); markNeedsLayout();
} }
final bool _applyTextScaleFactorToWidgetSpan;
@override @override
double computeMinIntrinsicWidth(double height) { double computeMinIntrinsicWidth(double height) {
if (!_canComputeIntrinsics()) { if (!_canComputeIntrinsics()) {
...@@ -540,7 +530,6 @@ class RenderParagraph extends RenderBox ...@@ -540,7 +530,6 @@ class RenderParagraph extends RenderBox
// The content will be enlarged by textScaleFactor during painting phase. // The content will be enlarged by textScaleFactor during painting phase.
// We reduce constraint by textScaleFactor so that the content will fit // We reduce constraint by textScaleFactor so that the content will fit
// into the box once it is enlarged. // into the box once it is enlarged.
if (_applyTextScaleFactorToWidgetSpan)
boxConstraints = boxConstraints / textScaleFactor; boxConstraints = boxConstraints / textScaleFactor;
while (child != null) { while (child != null) {
// Only constrain the width to the maximum width of the paragraph. // Only constrain the width to the maximum width of the paragraph.
......
...@@ -5201,7 +5201,6 @@ class RichText extends MultiChildRenderObjectWidget { ...@@ -5201,7 +5201,6 @@ class RichText extends MultiChildRenderObjectWidget {
assert(textScaleFactor != null), assert(textScaleFactor != null),
assert(maxLines == null || maxLines > 0), assert(maxLines == null || maxLines > 0),
assert(textWidthBasis != null), assert(textWidthBasis != null),
_applyTextScaleFactorToWidgetSpan = applyTextScaleFactorToWidgetSpan,
super(key: key, children: _extractChildren(text)); super(key: key, children: _extractChildren(text));
// Traverses the InlineSpan tree and depth-first collects the list of // Traverses the InlineSpan tree and depth-first collects the list of
...@@ -5279,8 +5278,6 @@ class RichText extends MultiChildRenderObjectWidget { ...@@ -5279,8 +5278,6 @@ class RichText extends MultiChildRenderObjectWidget {
/// {@macro flutter.dart:ui.textHeightBehavior} /// {@macro flutter.dart:ui.textHeightBehavior}
final ui.TextHeightBehavior textHeightBehavior; final ui.TextHeightBehavior textHeightBehavior;
final bool _applyTextScaleFactorToWidgetSpan;
@override @override
RenderParagraph createRenderObject(BuildContext context) { RenderParagraph createRenderObject(BuildContext context) {
assert(textDirection != null || debugCheckHasDirectionality(context)); assert(textDirection != null || debugCheckHasDirectionality(context));
...@@ -5294,7 +5291,6 @@ class RichText extends MultiChildRenderObjectWidget { ...@@ -5294,7 +5291,6 @@ class RichText extends MultiChildRenderObjectWidget {
strutStyle: strutStyle, strutStyle: strutStyle,
textWidthBasis: textWidthBasis, textWidthBasis: textWidthBasis,
textHeightBehavior: textHeightBehavior, textHeightBehavior: textHeightBehavior,
applyTextScaleFactorToWidgetSpan: _applyTextScaleFactorToWidgetSpan,
locale: locale ?? Localizations.localeOf(context, nullOk: true), locale: locale ?? Localizations.localeOf(context, nullOk: true),
); );
} }
......
...@@ -361,7 +361,6 @@ class Text extends StatelessWidget { ...@@ -361,7 +361,6 @@ class Text extends StatelessWidget {
'A non-null String must be provided to a Text widget.', 'A non-null String must be provided to a Text widget.',
), ),
textSpan = null, textSpan = null,
_applyTextScaleFactorToWidgetSpan = true,
super(key: key); super(key: key);
/// Creates a text widget with a [InlineSpan]. /// Creates a text widget with a [InlineSpan].
...@@ -401,7 +400,6 @@ class Text extends StatelessWidget { ...@@ -401,7 +400,6 @@ class Text extends StatelessWidget {
'A non-null TextSpan must be provided to a Text.rich widget.', 'A non-null TextSpan must be provided to a Text.rich widget.',
), ),
data = null, data = null,
_applyTextScaleFactorToWidgetSpan = applyTextScaleFactorToWidgetSpan,
super(key: key); super(key: key);
/// The text to display. /// The text to display.
...@@ -504,8 +502,6 @@ class Text extends StatelessWidget { ...@@ -504,8 +502,6 @@ class Text extends StatelessWidget {
/// {@macro flutter.dart:ui.textHeightBehavior} /// {@macro flutter.dart:ui.textHeightBehavior}
final ui.TextHeightBehavior textHeightBehavior; final ui.TextHeightBehavior textHeightBehavior;
final bool _applyTextScaleFactorToWidgetSpan;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final DefaultTextStyle defaultTextStyle = DefaultTextStyle.of(context); final DefaultTextStyle defaultTextStyle = DefaultTextStyle.of(context);
...@@ -525,7 +521,6 @@ class Text extends StatelessWidget { ...@@ -525,7 +521,6 @@ class Text extends StatelessWidget {
strutStyle: strutStyle, strutStyle: strutStyle,
textWidthBasis: textWidthBasis ?? defaultTextStyle.textWidthBasis, textWidthBasis: textWidthBasis ?? defaultTextStyle.textWidthBasis,
textHeightBehavior: textHeightBehavior ?? defaultTextStyle.textHeightBehavior ?? DefaultTextHeightBehavior.of(context), textHeightBehavior: textHeightBehavior ?? defaultTextStyle.textHeightBehavior ?? DefaultTextHeightBehavior.of(context),
applyTextScaleFactorToWidgetSpan: _applyTextScaleFactorToWidgetSpan,
text: TextSpan( text: TextSpan(
style: effectiveTextStyle, style: effectiveTextStyle,
text: data, text: data,
......
...@@ -186,7 +186,6 @@ void main() { ...@@ -186,7 +186,6 @@ void main() {
key: key, key: key,
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
textScaleFactor: textScaleFactor, textScaleFactor: textScaleFactor,
applyTextScaleFactorToWidgetSpan: true,
), ),
), ),
), ),
...@@ -215,7 +214,6 @@ void main() { ...@@ -215,7 +214,6 @@ void main() {
key: key, key: key,
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
textScaleFactor: textScaleFactor, textScaleFactor: textScaleFactor,
applyTextScaleFactorToWidgetSpan: true,
), ),
), ),
), ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment