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
d1707ab0
Unverified
Commit
d1707ab0
authored
Feb 14, 2019
by
Michael Goderbauer
Committed by
GitHub
Feb 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fix overflow clipping/fading for text (#27892)" (#27966)
This reverts commit
46cabdab
.
parent
e99c881f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
70 deletions
+1
-70
paragraph.dart
packages/flutter/lib/src/rendering/paragraph.dart
+1
-1
text_test.dart
packages/flutter/test/widgets/text_test.dart
+0
-69
No files found.
packages/flutter/lib/src/rendering/paragraph.dart
View file @
d1707ab0
...
...
@@ -287,9 +287,9 @@ class RenderParagraph extends RenderBox {
// Other _textPainter state like didExceedMaxLines will also be affected.
// See also RenderEditable which has a similar issue.
final
Size
textSize
=
_textPainter
.
size
;
final
bool
didOverflowHeight
=
_textPainter
.
didExceedMaxLines
;
size
=
constraints
.
constrain
(
textSize
);
final
bool
didOverflowHeight
=
size
.
height
<
textSize
.
height
||
_textPainter
.
didExceedMaxLines
;
final
bool
didOverflowWidth
=
size
.
width
<
textSize
.
width
;
// TODO(abarth): We're only measuring the sizes of the line boxes here. If
// the glyphs draw outside the line boxes, we might think that there isn't
...
...
packages/flutter/test/widgets/text_test.dart
View file @
d1707ab0
...
...
@@ -7,7 +7,6 @@ import 'package:flutter_test/flutter_test.dart';
import
'package:flutter/widgets.dart'
;
import
'package:flutter/foundation.dart'
;
import
'../rendering/mock_canvas.dart'
;
import
'semantics_tester.dart'
;
void
main
(
)
{
...
...
@@ -247,72 +246,4 @@ void main() {
expect
(
semantics
,
hasSemantics
(
expectedSemantics
,
ignoreTransform:
true
,
ignoreId:
true
));
semantics
.
dispose
();
},
skip:
true
);
// TODO(jonahwilliams): correct once https://github.com/flutter/flutter/issues/20891 is resolved.
testWidgets
(
'Overflow is clipping correctly - short text with overflow: clip'
,
(
WidgetTester
tester
)
async
{
await
_pumpTextWidget
(
tester:
tester
,
overflow:
TextOverflow
.
clip
,
text:
'Hi'
,
);
expect
(
find
.
byType
(
Text
),
isNot
(
paints
..
clipRect
()));
});
testWidgets
(
'Overflow is clipping correctly - long text with overflow: ellipsis'
,
(
WidgetTester
tester
)
async
{
await
_pumpTextWidget
(
tester:
tester
,
overflow:
TextOverflow
.
ellipsis
,
text:
'a long long long long text, should be clip'
,
);
expect
(
find
.
byType
(
Text
),
paints
..
clipRect
(
rect:
Rect
.
fromLTWH
(
0
,
0
,
50
,
50
)));
});
testWidgets
(
'Overflow is clipping correctly - short text with overflow: ellipsis'
,
(
WidgetTester
tester
)
async
{
await
_pumpTextWidget
(
tester:
tester
,
overflow:
TextOverflow
.
ellipsis
,
text:
'Hi'
,
);
expect
(
find
.
byType
(
Text
),
isNot
(
paints
..
clipRect
()));
});
testWidgets
(
'Overflow is clipping correctly - long text with overflow: fade'
,
(
WidgetTester
tester
)
async
{
await
_pumpTextWidget
(
tester:
tester
,
overflow:
TextOverflow
.
fade
,
text:
'a long long long long text, should be clip'
,
);
expect
(
find
.
byType
(
Text
),
paints
..
clipRect
(
rect:
Rect
.
fromLTWH
(
0
,
0
,
50
,
50
)));
});
testWidgets
(
'Overflow is clipping correctly - short text with overflow: fade'
,
(
WidgetTester
tester
)
async
{
await
_pumpTextWidget
(
tester:
tester
,
overflow:
TextOverflow
.
fade
,
text:
'Hi'
,
);
expect
(
find
.
byType
(
Text
),
isNot
(
paints
..
clipRect
()));
});
}
Future
<
void
>
_pumpTextWidget
({
WidgetTester
tester
,
String
text
,
TextOverflow
overflow
})
{
return
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Center
(
child:
Container
(
width:
50.0
,
height:
50.0
,
child:
Text
(
text
,
overflow:
overflow
,
),
),
),
),
);
}
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