Unverified Commit 73798a15 authored by Shi-Hao Hong's avatar Shi-Hao Hong Committed by GitHub

Explain hairline rendering in BorderSide.width docs (#33226)

parent c99ed8fe
...@@ -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 no [BorderStyle.none]. /// style to [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].
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment