Explain hairline rendering in BorderSide.width docs (#33226)
This commit is contained in:
parent
c99ed8fed9
commit
73798a1592
@ -26,6 +26,9 @@ enum BorderStyle {
|
||||
/// A [Border] consists of four [BorderSide] objects: [Border.top],
|
||||
/// [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}
|
||||
///
|
||||
/// This sample shows how [BorderSide] objects can be used in a [Container], via
|
||||
@ -103,9 +106,15 @@ class BorderSide {
|
||||
/// The color of this side of the border.
|
||||
final Color color;
|
||||
|
||||
/// The width of this side of the border, in logical pixels. A
|
||||
/// zero-width border is a hairline border. To omit the border
|
||||
/// entirely, set the [style] to [BorderStyle.none].
|
||||
/// The width of this side of the border, in logical pixels.
|
||||
///
|
||||
/// 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;
|
||||
|
||||
/// The style of this side of the border.
|
||||
@ -143,7 +152,7 @@ class BorderSide {
|
||||
///
|
||||
/// 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
|
||||
/// style no [BorderStyle.none].
|
||||
/// style to [BorderStyle.none].
|
||||
///
|
||||
/// Values for `t` are usually obtained from an [Animation<double>], such as
|
||||
/// an [AnimationController].
|
||||
|
Loading…
x
Reference in New Issue
Block a user