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
a88e2c87
Unverified
Commit
a88e2c87
authored
Jun 22, 2020
by
renyou
Committed by
GitHub
Jun 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "fix the widget span layout when text scale factor != 1 (#59711)" (#59986)
This reverts commit
747fe345
.
parent
04ce9d28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
66 deletions
+3
-66
paragraph.dart
packages/flutter/lib/src/rendering/paragraph.dart
+3
-4
text_test.dart
packages/flutter/test/widgets/text_test.dart
+0
-62
No files found.
packages/flutter/lib/src/rendering/paragraph.dart
View file @
a88e2c87
...
...
@@ -530,10 +530,9 @@ class RenderParagraph extends RenderBox
// Only constrain the width to the maximum width of the paragraph.
// Leave height unconstrained, which will overflow if expanded past.
child
.
layout
(
// The content will be enlarged by textScaleFactor during painting phase.
// We reduce contraint by textScaleFactor so that the content will fit
// into the box once it is enlarged.
BoxConstraints
(
maxWidth:
constraints
.
maxWidth
)
/
textScaleFactor
,
BoxConstraints
(
maxWidth:
constraints
.
maxWidth
,
),
parentUsesSize:
true
,
);
double
baselineOffset
;
...
...
packages/flutter/test/widgets/text_test.dart
View file @
a88e2c87
...
...
@@ -163,68 +163,6 @@ void main() {
expect
(
tester
.
takeException
(),
null
);
},
skip:
isBrowser
);
// TODO(yjbanov): https://github.com/flutter/flutter/issues/42086
testWidgets
(
'inline widgets works with textScaleFactor'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/59316
final
UniqueKey
key
=
UniqueKey
();
double
textScaleFactor
=
1.0
;
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'title'
)),
body:
Center
(
child:
Text
.
rich
(
TextSpan
(
children:
<
InlineSpan
>[
WidgetSpan
(
child:
RichText
(
text:
const
TextSpan
(
text:
'widget should be truncated'
),
textDirection:
TextDirection
.
ltr
,
),
),
],
),
key:
key
,
textDirection:
TextDirection
.
ltr
,
textScaleFactor:
textScaleFactor
,
),
),
),
),
);
RenderBox
renderText
=
tester
.
renderObject
(
find
.
byKey
(
key
));
final
double
singleLineHeight
=
renderText
.
size
.
height
;
// Now, increases the text scale factor by 5 times.
textScaleFactor
=
textScaleFactor
*
5
;
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'title'
)),
body:
Center
(
child:
Text
.
rich
(
TextSpan
(
children:
<
InlineSpan
>[
WidgetSpan
(
child:
RichText
(
text:
const
TextSpan
(
text:
'widget should be truncated'
),
textDirection:
TextDirection
.
ltr
,
),
),
],
),
key:
key
,
textDirection:
TextDirection
.
ltr
,
textScaleFactor:
textScaleFactor
,
),
),
),
),
);
renderText
=
tester
.
renderObject
(
find
.
byKey
(
key
));
// The RichText in the widget span should wrap into three lines.
expect
(
renderText
.
size
.
height
,
singleLineHeight
*
textScaleFactor
*
3
);
},
skip:
isBrowser
);
// TODO(yjbanov): https://github.com/flutter/flutter/issues/42086
testWidgets
(
'semanticsLabel can override text label'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
await
tester
.
pumpWidget
(
...
...
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