pub struct LinearBorder {
pub side: BorderSide,
pub start: Option<LinearBorderEdge>,
pub end: Option<LinearBorderEdge>,
pub top: Option<LinearBorderEdge>,
pub bottom: Option<LinearBorderEdge>,
}Expand description
An OutlinedBorder like BoxBorder that allows one to define a
rectangular (box) border in terms of zero to four LinearBorderEdges,
each of which is rendered as a single line.
This class resolves itself against the current TextDirection. Start and
end values resolve to left and right for TextDirection::Ltr and to
right and left for TextDirection::Rtl.
Fields§
§side: BorderSideThe border outline’s color and weight.
start: Option<LinearBorderEdge>Defines the left edge for TextDirection::Ltr or the right for
TextDirection::Rtl.
end: Option<LinearBorderEdge>Defines the right edge for TextDirection::Ltr or the left for
TextDirection::Rtl.
top: Option<LinearBorderEdge>Defines the top edge.
bottom: Option<LinearBorderEdge>Defines the bottom edge.
Implementations§
Source§impl LinearBorder
impl LinearBorder
Sourcepub const NONE: LinearBorder
pub const NONE: LinearBorder
No border.
Sourcepub fn new() -> LinearBorder
pub fn new() -> LinearBorder
Creates a rectangular box border that’s rendered as zero to four lines.
Sourcepub fn side(self, side: BorderSide) -> LinearBorder
pub fn side(self, side: BorderSide) -> LinearBorder
The color and width of each line.
Sourcepub fn start(self, start: LinearBorderEdge) -> LinearBorder
pub fn start(self, start: LinearBorderEdge) -> LinearBorder
Defines the left edge for TextDirection::Ltr or the right for
TextDirection::Rtl.
Sourcepub fn end(self, end: LinearBorderEdge) -> LinearBorder
pub fn end(self, end: LinearBorderEdge) -> LinearBorder
Defines the right edge for TextDirection::Ltr or the left for
TextDirection::Rtl.
Sourcepub fn top(self, top: LinearBorderEdge) -> LinearBorder
pub fn top(self, top: LinearBorderEdge) -> LinearBorder
Defines the top edge.
Sourcepub fn bottom(self, bottom: LinearBorderEdge) -> LinearBorder
pub fn bottom(self, bottom: LinearBorderEdge) -> LinearBorder
Defines the bottom edge.
Sourcepub fn start_side(side: BorderSide, alignment: f64, size: f64) -> LinearBorder
pub fn start_side(side: BorderSide, alignment: f64, size: f64) -> LinearBorder
Creates a rectangular box border with an edge on the left for
TextDirection::Ltr or on the right for TextDirection::Rtl.
Sourcepub fn end_side(side: BorderSide, alignment: f64, size: f64) -> LinearBorder
pub fn end_side(side: BorderSide, alignment: f64, size: f64) -> LinearBorder
Creates a rectangular box border with an edge on the right for
TextDirection::Ltr or on the left for TextDirection::Rtl.
Sourcepub fn top_side(side: BorderSide, alignment: f64, size: f64) -> LinearBorder
pub fn top_side(side: BorderSide, alignment: f64, size: f64) -> LinearBorder
Creates a rectangular box border with an edge on the top.
Sourcepub fn bottom_side(side: BorderSide, alignment: f64, size: f64) -> LinearBorder
pub fn bottom_side(side: BorderSide, alignment: f64, size: f64) -> LinearBorder
Creates a rectangular box border with an edge on the bottom.
Sourcepub fn scale(&self, t: f64) -> LinearBorder
pub fn scale(&self, t: f64) -> LinearBorder
Creates a copy of this border, scaled by the factor t.
Sourcepub fn copy_with(&self) -> LinearBorder
pub fn copy_with(&self) -> LinearBorder
Creates a copy of this object. Chain setters to replace fields
(border.copy_with().side(s).start(e)).
Trait Implementations§
Source§impl Clone for LinearBorder
impl Clone for LinearBorder
Source§fn clone(&self) -> LinearBorder
fn clone(&self) -> LinearBorder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LinearBorder
Source§impl Debug for LinearBorder
impl Debug for LinearBorder
Source§impl Default for LinearBorder
impl Default for LinearBorder
Source§fn default() -> LinearBorder
fn default() -> LinearBorder
Source§impl OutlinedBorder for LinearBorder
impl OutlinedBorder for LinearBorder
Source§fn side(&self) -> BorderSide
fn side(&self) -> BorderSide
Source§fn copy_with(&self, side: Option<BorderSide>) -> OutlinedBorderRef
fn copy_with(&self, side: Option<BorderSide>) -> OutlinedBorderRef
OutlinedBorder that draws its outline with the
specified side, if side is Some.Source§impl PartialEq for LinearBorder
impl PartialEq for LinearBorder
Source§impl ShapeBorder for LinearBorder
impl ShapeBorder for LinearBorder
Source§fn dimensions(&self) -> EdgeInsetsGeometry
fn dimensions(&self) -> EdgeInsetsGeometry
EdgeInsetsGeometry.Source§fn scale(&self, t: f64) -> ShapeBorderRef
fn scale(&self, t: f64) -> ShapeBorderRef
t.Source§fn lerp_from(
&self,
a: Option<&(dyn ShapeBorder + 'static)>,
t: f64,
) -> Option<ShapeBorderRef>
fn lerp_from( &self, a: Option<&(dyn ShapeBorder + 'static)>, t: f64, ) -> Option<ShapeBorderRef>
Source§fn lerp_to(
&self,
b: Option<&(dyn ShapeBorder + 'static)>,
t: f64,
) -> Option<ShapeBorderRef>
fn lerp_to( &self, b: Option<&(dyn ShapeBorder + 'static)>, t: f64, ) -> Option<ShapeBorderRef>
Source§fn get_inner_path(
&self,
rect: Rect,
text_direction: Option<TextDirection>,
) -> Path
fn get_inner_path( &self, rect: Rect, text_direction: Option<TextDirection>, ) -> Path
Path that describes the inner edge of the border.Source§fn get_outer_path(
&self,
rect: Rect,
_text_direction: Option<TextDirection>,
) -> Path
fn get_outer_path( &self, rect: Rect, _text_direction: Option<TextDirection>, ) -> Path
Path that describes the outer edge of the border.Source§fn paint(
&self,
canvas: &mut DisplayListBuilder,
rect: Rect,
text_direction: Option<TextDirection>,
)
fn paint( &self, canvas: &mut DisplayListBuilder, rect: Rect, text_direction: Option<TextDirection>, )
Source§fn as_outlined_border(&self) -> Option<&(dyn OutlinedBorder + 'static)>
fn as_outlined_border(&self) -> Option<&(dyn OutlinedBorder + 'static)>
OutlinedBorder downcast for Dart’s is OutlinedBorder.Source§fn into_outlined_border(
self: Rc<LinearBorder>,
) -> Option<Rc<dyn OutlinedBorder>>
fn into_outlined_border( self: Rc<LinearBorder>, ) -> Option<Rc<dyn OutlinedBorder>>
OutlinedBorder downcast of the shared border, for Dart’s as OutlinedBorder
(ShapeBorderRef::as_outlined_border_ref). An OutlinedBorder answers Some(self),
as it answers as_outlined_border.Source§fn eq_shape(&self, other: &(dyn ShapeBorder + 'static)) -> bool
fn eq_shape(&self, other: &(dyn ShapeBorder + 'static)) -> bool
== is identity; subclasses that override
== implement this.Source§fn add(&self, other: &ShapeBorderRef, reversed: bool) -> Option<ShapeBorderRef>
fn add(&self, other: &ShapeBorderRef, reversed: bool) -> Option<ShapeBorderRef>
this border and the other border. Read moreSource§fn hit_test(
&self,
rect: Rect,
position: Offset,
text_direction: Option<TextDirection>,
) -> bool
fn hit_test( &self, rect: Rect, position: Offset, text_direction: Option<TextDirection>, ) -> bool
position.Source§fn paint_interior(
&self,
canvas: &mut DisplayListBuilder,
rect: Rect,
paint: &Paint,
text_direction: Option<TextDirection>,
)
fn paint_interior( &self, canvas: &mut DisplayListBuilder, rect: Rect, paint: &Paint, text_direction: Option<TextDirection>, )
Source§fn prefer_paint_interior(&self) -> bool
fn prefer_paint_interior(&self) -> bool
paint_interior is implemented.Source§fn as_box_border(&self) -> Option<&(dyn BoxBorder + 'static)>
fn as_box_border(&self) -> Option<&(dyn BoxBorder + 'static)>
BoxBorder downcast for BoxBorderRef::lerp.Source§fn into_box_border(self: Rc<Self>) -> Option<Rc<dyn BoxBorder>>
fn into_box_border(self: Rc<Self>) -> Option<Rc<dyn BoxBorder>>
BoxBorder downcast of the shared border
(ShapeBorderRef::as_box_border_ref). A box border answers Some(self), as it
answers as_box_border.