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
902391b0
Commit
902391b0
authored
Apr 01, 2016
by
Ian Hickson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Realign the slow mode banner to not overflow.
parent
a05909e3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
banner.dart
packages/flutter/lib/src/widgets/banner.dart
+3
-4
No files found.
packages/flutter/lib/src/widgets/banner.dart
View file @
902391b0
...
...
@@ -22,7 +22,6 @@ class BannerPainter extends CustomPainter {
static
const
double
kOffset
=
40.0
;
// distance to bottom of banner, at a 45 degree angle inwards
static
const
double
kHeight
=
12.0
;
// height of banner
static
const
double
kBottomOffset
=
kOffset
+
0.707
*
kHeight
;
// offset plus sqrt(2)/2 * banner height
static
const
Offset
kTextAlign
=
const
Offset
(
0.0
,
-
3.0
);
// offset to move text up
static
const
double
kFontSize
=
kHeight
*
0.85
;
static
const
double
kShadowBlur
=
4.0
;
// shadow blur sigma
static
final
Rect
kRect
=
new
Rect
.
fromLTWH
(-
kOffset
,
kOffset
-
kHeight
,
kOffset
*
2.0
,
kHeight
);
...
...
@@ -30,7 +29,8 @@ class BannerPainter extends CustomPainter {
color:
const
Color
(
0xFFFFFFFF
),
fontSize:
kFontSize
,
fontWeight:
FontWeight
.
w900
,
textAlign:
TextAlign
.
center
textAlign:
TextAlign
.
center
,
height:
1.0
);
@override
...
...
@@ -49,10 +49,9 @@ class BannerPainter extends CustomPainter {
final
TextPainter
textPainter
=
new
TextPainter
()
..
text
=
new
TextSpan
(
style:
kTextStyles
,
text:
message
)
..
maxWidth
=
kOffset
*
2.0
..
maxHeight
=
kHeight
..
layout
();
textPainter
.
paint
(
canvas
,
kRect
.
topLeft
.
toOffset
()
+
kTextAlign
);
textPainter
.
paint
(
canvas
,
kRect
.
topLeft
.
toOffset
()
+
new
Offset
(
0.0
,
(
kRect
.
height
-
textPainter
.
height
)
/
2.0
)
);
}
@override
...
...
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