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
0d1cc33b
Unverified
Commit
0d1cc33b
authored
Jul 17, 2023
by
LongCatIsLooong
Committed by
GitHub
Jul 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`_RenderScaledInlineWidget` constrains child size (#130648)
Fixes
https://github.com/flutter/flutter/issues/130588
parent
bf4d6597
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
widget_span.dart
packages/flutter/lib/src/widgets/widget_span.dart
+1
-1
text_test.dart
packages/flutter/test/widgets/text_test.dart
+17
-0
No files found.
packages/flutter/lib/src/widgets/widget_span.dart
View file @
0d1cc33b
...
...
@@ -375,7 +375,7 @@ class _RenderScaledInlineWidget extends RenderBox with RenderObjectWithChildMixi
// Only constrain the width to the maximum width of the paragraph.
// Leave height unconstrained, which will overflow if expanded past.
child
.
layout
(
BoxConstraints
(
maxWidth:
constraints
.
maxWidth
/
scale
),
parentUsesSize:
true
);
size
=
c
hild
.
size
*
scale
;
size
=
c
onstraints
.
constrain
(
child
.
size
*
scale
)
;
}
@override
...
...
packages/flutter/test/widgets/text_test.dart
View file @
0d1cc33b
...
...
@@ -266,6 +266,23 @@ void main() {
expect
(
renderText
.
size
.
height
,
singleLineHeight
*
textScaleFactor
*
3
);
});
testWidgets
(
"Inline widgets' scaled sizes are constrained"
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/130588
await
tester
.
pumpWidget
(
const
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Center
(
child:
SizedBox
(
width:
100.3
,
child:
Text
.
rich
(
WidgetSpan
(
child:
Row
()),
textScaleFactor:
0.3
),
),
),
),
);
expect
(
tester
.
takeException
(),
isNull
);
});
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