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
73798a15
Unverified
Commit
73798a15
authored
May 24, 2019
by
Shi-Hao Hong
Committed by
GitHub
May 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explain hairline rendering in BorderSide.width docs (#33226)
parent
c99ed8fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
borders.dart
packages/flutter/lib/src/painting/borders.dart
+13
-4
No files found.
packages/flutter/lib/src/painting/borders.dart
View file @
73798a15
...
@@ -26,6 +26,9 @@ enum BorderStyle {
...
@@ -26,6 +26,9 @@ enum BorderStyle {
/// A [Border] consists of four [BorderSide] objects: [Border.top],
/// A [Border] consists of four [BorderSide] objects: [Border.top],
/// [Border.left], [Border.right], and [Border.bottom].
/// [Border.left], [Border.right], and [Border.bottom].
///
///
/// Note that setting [BorderSide.width] to 0.0 will result in hairline
/// rendering. A more involved explanation is present in [BorderSide.width].
///
/// {@tool sample}
/// {@tool sample}
///
///
/// This sample shows how [BorderSide] objects can be used in a [Container], via
/// This sample shows how [BorderSide] objects can be used in a [Container], via
...
@@ -103,9 +106,15 @@ class BorderSide {
...
@@ -103,9 +106,15 @@ class BorderSide {
/// The color of this side of the border.
/// The color of this side of the border.
final
Color
color
;
final
Color
color
;
/// The width of this side of the border, in logical pixels. A
/// The width of this side of the border, in logical pixels.
/// zero-width border is a hairline border. To omit the border
///
/// entirely, set the [style] to [BorderStyle.none].
/// Setting width to 0.0 will result in a hairline border. This means that
/// the border will have the width of one physical pixel. Also, hairline
/// rendering takes shortcuts when the path overlaps a pixel more than once.
/// This means that it will render faster than otherwise, but it might
/// double-hit pixels, giving it a slightly darker/lighter result.
///
/// To omit the border entirely, set the [style] to [BorderStyle.none].
final
double
width
;
final
double
width
;
/// The style of this side of the border.
/// The style of this side of the border.
...
@@ -143,7 +152,7 @@ class BorderSide {
...
@@ -143,7 +152,7 @@ class BorderSide {
///
///
/// Since a zero width is normally painted as a hairline width rather than no
/// Since a zero width is normally painted as a hairline width rather than no
/// border at all, the zero factor is special-cased to instead change the
/// border at all, the zero factor is special-cased to instead change the
/// style
n
o [BorderStyle.none].
/// style
t
o [BorderStyle.none].
///
///
/// Values for `t` are usually obtained from an [Animation<double>], such as
/// Values for `t` are usually obtained from an [Animation<double>], such as
/// an [AnimationController].
/// an [AnimationController].
...
...
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