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
d77955fb
Commit
d77955fb
authored
Aug 31, 2017
by
Jason Simmons
Committed by
GitHub
Aug 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass the width constraint to the text layout engine if ellipsizing is enabled (#11877)
parent
c5750cd7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
paragraph.dart
packages/flutter/lib/src/rendering/paragraph.dart
+4
-1
paragraph_test.dart
packages/flutter/test/rendering/paragraph_test.dart
+1
-1
No files found.
packages/flutter/lib/src/rendering/paragraph.dart
View file @
d77955fb
...
...
@@ -148,7 +148,10 @@ class RenderParagraph extends RenderBox {
}
void
_layoutText
({
double
minWidth:
0.0
,
double
maxWidth:
double
.
INFINITY
})
{
_textPainter
.
layout
(
minWidth:
minWidth
,
maxWidth:
_softWrap
?
maxWidth
:
double
.
INFINITY
);
_textPainter
.
layout
(
minWidth:
minWidth
,
maxWidth:
_softWrap
||
_overflow
==
TextOverflow
.
ellipsis
?
maxWidth
:
double
.
INFINITY
);
}
void
_layoutTextWithConstraints
(
BoxConstraints
constraints
)
{
...
...
packages/flutter/test/rendering/paragraph_test.dart
View file @
d77955fb
...
...
@@ -132,7 +132,7 @@ void main() {
expect
(
paragraph
.
size
.
height
,
equals
(
lineHeight
));
relayoutWith
(
maxLines:
3
,
softWrap:
false
,
overflow:
TextOverflow
.
ellipsis
);
expect
(
paragraph
.
size
.
height
,
equals
(
2
*
lineHeight
));
expect
(
paragraph
.
size
.
height
,
equals
(
3
*
lineHeight
));
relayoutWith
(
maxLines:
null
,
softWrap:
false
,
overflow:
TextOverflow
.
ellipsis
);
expect
(
paragraph
.
size
.
height
,
equals
(
2
*
lineHeight
));
...
...
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