Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
561735ad
Unverified
Commit
561735ad
authored
Jul 23, 2020
by
chunhtai
Committed by
GitHub
Jul 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "remove usage to applyTextScaleFactorToWidgetSpan (#61636)" (#62144)
This reverts commit
c816fabd
.
parent
8428cf30
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
1 deletion
+23
-1
paragraph.dart
packages/flutter/lib/src/rendering/paragraph.dart
+12
-1
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+4
-0
text.dart
packages/flutter/lib/src/widgets/text.dart
+5
-0
text_test.dart
packages/flutter/test/widgets/text_test.dart
+2
-0
No files found.
packages/flutter/lib/src/rendering/paragraph.dart
View file @
561735ad
...
...
@@ -79,6 +79,13 @@ class RenderParagraph extends RenderBox
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
()),
...
...
@@ -91,6 +98,7 @@ class RenderParagraph extends RenderBox
assert
(
textWidthBasis
!=
null
),
_softWrap
=
softWrap
,
_overflow
=
overflow
,
_applyTextScaleFactorToWidgetSpan
=
applyTextScaleFactorToWidgetSpan
,
_textPainter
=
TextPainter
(
text:
text
,
textAlign:
textAlign
,
...
...
@@ -290,6 +298,8 @@ class RenderParagraph extends RenderBox
markNeedsLayout
();
}
final
bool
_applyTextScaleFactorToWidgetSpan
;
@override
double
computeMinIntrinsicWidth
(
double
height
)
{
if
(!
_canComputeIntrinsics
())
{
...
...
@@ -530,6 +540,7 @@ class RenderParagraph extends RenderBox
// 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
;
while
(
child
!=
null
)
{
// Only constrain the width to the maximum width of the paragraph.
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
561735ad
...
...
@@ -5200,6 +5200,7 @@ class RichText extends MultiChildRenderObjectWidget {
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
...
...
@@ -5277,6 +5278,8 @@ class RichText extends MultiChildRenderObjectWidget {
/// {@macro flutter.dart:ui.textHeightBehavior}
final
ui
.
TextHeightBehavior
textHeightBehavior
;
final
bool
_applyTextScaleFactorToWidgetSpan
;
@override
RenderParagraph
createRenderObject
(
BuildContext
context
)
{
assert
(
textDirection
!=
null
||
debugCheckHasDirectionality
(
context
));
...
...
@@ -5290,6 +5293,7 @@ class RichText extends MultiChildRenderObjectWidget {
strutStyle:
strutStyle
,
textWidthBasis:
textWidthBasis
,
textHeightBehavior:
textHeightBehavior
,
applyTextScaleFactorToWidgetSpan:
_applyTextScaleFactorToWidgetSpan
,
locale:
locale
??
Localizations
.
localeOf
(
context
,
nullOk:
true
),
);
}
...
...
packages/flutter/lib/src/widgets/text.dart
View file @
561735ad
...
...
@@ -361,6 +361,7 @@ class Text extends StatelessWidget {
'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].
...
...
@@ -400,6 +401,7 @@ class Text extends StatelessWidget {
'A non-null TextSpan must be provided to a Text.rich widget.'
,
),
data
=
null
,
_applyTextScaleFactorToWidgetSpan
=
applyTextScaleFactorToWidgetSpan
,
super
(
key:
key
);
/// The text to display.
...
...
@@ -502,6 +504,8 @@ class Text extends StatelessWidget {
/// {@macro flutter.dart:ui.textHeightBehavior}
final
ui
.
TextHeightBehavior
textHeightBehavior
;
final
bool
_applyTextScaleFactorToWidgetSpan
;
@override
Widget
build
(
BuildContext
context
)
{
final
DefaultTextStyle
defaultTextStyle
=
DefaultTextStyle
.
of
(
context
);
...
...
@@ -521,6 +525,7 @@ class Text extends StatelessWidget {
strutStyle:
strutStyle
,
textWidthBasis:
textWidthBasis
??
defaultTextStyle
.
textWidthBasis
,
textHeightBehavior:
textHeightBehavior
??
defaultTextStyle
.
textHeightBehavior
??
DefaultTextHeightBehavior
.
of
(
context
),
applyTextScaleFactorToWidgetSpan:
_applyTextScaleFactorToWidgetSpan
,
text:
TextSpan
(
style:
effectiveTextStyle
,
text:
data
,
...
...
packages/flutter/test/widgets/text_test.dart
View file @
561735ad
...
...
@@ -186,6 +186,7 @@ void main() {
key:
key
,
textDirection:
TextDirection
.
ltr
,
textScaleFactor:
textScaleFactor
,
applyTextScaleFactorToWidgetSpan:
true
,
),
),
),
...
...
@@ -214,6 +215,7 @@ void main() {
key:
key
,
textDirection:
TextDirection
.
ltr
,
textScaleFactor:
textScaleFactor
,
applyTextScaleFactorToWidgetSpan:
true
,
),
),
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment